|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.util.StringUtilities
public class StringUtilities
Provides convenience methods for string handling.
Method Summary | |
---|---|
boolean |
containsWord(String search,
String word)
Try to find a word within a String. |
String |
convertAmpersands(String value)
Convert ampersands (&) in the given string to their XML/HTML equivalents. |
String |
convertApostrophes(String value)
Convert apostophes (') in the given string to their XML/HTML equivalents. |
String |
convertBrackets(String value)
Convert brackets (<,>) in the given string to their XML/HTML equivalents. |
String |
convertNewlines(String value)
Convert newlines (\\n) in the given string to their XML/HTML equivalents. |
String |
convertQuotes(String value)
Convert quotes (") in the given string to their XML/HTML equivalents. |
String |
convertSpaces(String value)
Convert spaces ( ) in the given string to their XML/HTML equivalents. |
int |
countOccurrences(String value,
String key)
Return the count of occurrences of the given key in the given value. |
static StringUtilities |
getInstance()
Return the singleton instance of this class. |
boolean |
isNullOrEmpty(String stringToTest)
Tests if the given string is null or empty (length is zero). |
int |
occurrenceCount(String source,
String substring)
Return the number of times the given substring occurs in the given source string. |
String |
removePunctuation(String string)
Remove punctuation from the given string. |
String |
removeSpaces(String string)
Remove spaces from the given string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static StringUtilities getInstance()
public boolean containsWord(String search, String word)
search
- The string to search a word forword
- The string/word to search for
public String convertAmpersands(String value)
value
- The original string.
public String convertApostrophes(String value)
value
- The original string.
public String convertBrackets(String value)
value
- The original string.
public String convertNewlines(String value)
value
- The original string.
public String convertQuotes(String value)
value
- The original string.
public String convertSpaces(String value)
value
- The original string.
public int countOccurrences(String value, String key)
value
- Value.key
- Key to count.public boolean isNullOrEmpty(String stringToTest)
stringToTest
- String to test for null or empty.
public int occurrenceCount(String source, String substring)
source
- Source string.substring
- Substring.public String removePunctuation(String string)
public String removeSpaces(String string)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |