|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sape.carbon.core.util.string.StringUtil
Utilities for strings.
Copyright 2002 Sapient
Constructor Summary | |
StringUtil()
|
Method Summary | |
static String |
capitalize(String s)
Capitalizes the first character of the given string. |
static Set |
convertToSet(char[] charArray)
Converts a char array to a Set. |
static Set |
convertToSet(String string)
Converts a string to a Set. |
static String[] |
parseCommaDelimitedList(String csvList)
Parses a comma-separated list into an array of Strings Values can contain whitespace, but whitespace at the beginning and end of each value is trimmed. |
static String[] |
parseList(String list,
String delim)
Parses a list according to the specified delimiter into an array of Strings. |
static String[] |
parseWhitespaceDelimitedList(String wsvList)
Parses a whitepsace-separated list into an array of Strings |
static String |
removeCharsFromString(String aString,
char[] unWantedCharArray)
Removes specified chars from a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringUtil()
Method Detail |
public static String capitalize(String s)
s
- the String to capitalize
public static String[] parseCommaDelimitedList(String csvList)
csvList
- a string of comma seperated values
public static String[] parseWhitespaceDelimitedList(String wsvList)
wsvList
- a string of white space seperated values
public static String[] parseList(String list, String delim)
list
- a string of token seperated valuesdelim
- the delimiter character(s). Each character in the string is a
single delimeter.
StringTokenizer
public static String removeCharsFromString(String aString, char[] unWantedCharArray)
Removes specified chars from a string.
aString
- the string that will be examined to remove charsunWantedCharArray
- the char array containing the chars
that should be removed from a string
public static Set convertToSet(String string)
Converts a string to a Set. Breaks the string to characters and store each character in a Set.
string
- the string to convert
Set
containing all characters in the text string parameterpublic static Set convertToSet(char[] charArray)
Converts a char array to a Set. Puts all characters in the array to a Set.
charArray
- an array of char
s
set
containing all characters in the char array
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |