Package org.apache.ws.security.util
Class StringUtil
- java.lang.Object
-
- org.apache.ws.security.util.StringUtil
-
public class StringUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]EMPTY_STRING_ARRAYAn empty immutableStringarray.
-
Constructor Summary
Constructors Constructor Description StringUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String[]split(java.lang.String str, char separatorChar)Splits the provided text into an array, separator specified.static booleanstartsWithIgnoreWhitespaces(java.lang.String prefix, java.lang.String string)Tests if this string starts with the specified prefix (Ignoring whitespaces)
-
-
-
Method Detail
-
startsWithIgnoreWhitespaces
public static boolean startsWithIgnoreWhitespaces(java.lang.String prefix, java.lang.String string)Tests if this string starts with the specified prefix (Ignoring whitespaces)- Parameters:
prefix-string-- Returns:
- boolean
-
split
public static java.lang.String[] split(java.lang.String str, char separatorChar)Splits the provided text into an array, separator specified. This is an alternative to using StringTokenizer.
The separator is not included in the returned String array. Adjacent separators are treated as one separator.
A
nullinput String returnsnull.StringUtils.split(null, *) = null StringUtils.split("", *) = [] StringUtils.split("a.b.c", '.') = ["a", "b", "c"] StringUtils.split("a..b.c", '.') = ["a", "b", "c"] StringUtils.split("a:b:c", '.') = ["a:b:c"] StringUtils.split("a\tb\nc", null) = ["a", "b", "c"] StringUtils.split("a b c", ' ') = ["a", "b", "c"]- Parameters:
str- the String to parse, may be nullseparatorChar- the character used as the delimiter,nullsplits on whitespace- Returns:
- an array of parsed Strings,
nullif null String input
-
-