Package helma.util
Class StringUtils
java.lang.Object
helma.util.StringUtils
Utility class for String manipulation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]
collect
(Enumeration en) Collect items of a string enumeration into a String array.static String
getCommonPrefix
(String s1, String s2) Get the largest common prefix of Strings s1 and s2static String[]
Split a string into an array of strings.static String[]
Split a string into an array of strings.static String[]
splitLines
(String str) Split a string into an array of lines.static char[]
toCharArray
(String str) Get the character array for a string.
-
Constructor Details
-
StringUtils
public StringUtils()
-
-
Method Details
-
split
Split a string into an array of strings. Use comma and space as delimiters. -
split
Split a string into an array of strings. -
splitLines
Split a string into an array of lines.- Parameters:
str
- the string to split- Returns:
- an array of lines
-
toCharArray
Get the character array for a string. Useful for use from Rhino, where the Java String methods are not readily available without constructing a new String instance.- Parameters:
str
- a string- Returns:
- the char array
-
collect
Collect items of a string enumeration into a String array.- Parameters:
en
- an enumeration of strings- Returns:
- the enumeration values as string array
-
getCommonPrefix
Get the largest common prefix of Strings s1 and s2- Parameters:
s1
- a strings2
- another string- Returns:
- the largest prefix shared by both strings
-