|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--arlut.csd.Util.StringUtils
This class contains a variety of utility String manipulating static methods for use in Ganymede.
| Constructor Summary | |
StringUtils()
|
|
| Method Summary | |
static boolean |
containsOnly(java.lang.String inputString,
java.lang.String legalChars)
This method tests to see if inputString consists of only characters contained within the legalChars string. |
static int |
count(java.lang.String inputString,
java.lang.String patternString)
This method takes an inputString and counts the number of times that patternString occurs within it. |
static java.lang.String |
replaceStr(java.lang.String inputString,
java.lang.String splitString,
java.lang.String joinString)
This method behaves like String.replace(), but replaces substrings rather than chars. |
static java.lang.String[] |
split(java.lang.String inputString,
java.lang.String splitString)
This method takes a (possibly multiline) inputString containing subsequences matching splitString and returns an array of Strings which contain the contents of the inputString between instances of the splitString. |
static java.lang.String |
strip(java.lang.String inputString,
java.lang.String legalChars)
This method strips out any characters from inputString that are not present in legalChars. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public StringUtils()
| Method Detail |
public static java.lang.String strip(java.lang.String inputString,
java.lang.String legalChars)
This method strips out any characters from inputString that are not present in legalChars.
This method will always return a non-null String.
public static boolean containsOnly(java.lang.String inputString,
java.lang.String legalChars)
This method tests to see if inputString consists of only characters contained within the legalChars string. If inputString contains no characters not contained within legalChars, containsOnly() will return true, otherwise it will return false.
Note that containsOnly will always return true if inputString is null.
public static int count(java.lang.String inputString,
java.lang.String patternString)
This method takes an inputString and counts the number of times that patternString occurs within it.
public static java.lang.String[] split(java.lang.String inputString,
java.lang.String splitString)
This method takes a (possibly multiline) inputString containing subsequences matching splitString and returns an array of Strings which contain the contents of the inputString between instances of the splitString. The splitString divider will not be returned in the split strings.
In particular, this can be used to split a multiline String into an array of Strings by using a splitString of "\n". The resulting strings will not include their terminating newlines.
public static java.lang.String replaceStr(java.lang.String inputString,
java.lang.String splitString,
java.lang.String joinString)
This method behaves like String.replace(), but replaces substrings rather than chars.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||