类 StringUtils
-
方法概要
修饰符和类型方法说明static StringfromUTF8Stream(InputStream stream) static com.google.common.collect.ImmutableList<String>static Stringstatic String[]tokenizeToStringArray(String str, String delimiters) Tokenize the given String into a String array via a StringTokenizer.static String[]tokenizeToStringArray(String str, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens) Tokenize the given String into a String array via a StringTokenizer.static String[]toStringArray(Collection<String> collection) Copy the given Collection into a String array.
-
方法详细资料
-
lower
-
fromUTF8Stream
- 抛出:
IOException
-
lines
-
tokenizeToStringArray
Tokenize the given String into a String array via a StringTokenizer. Trims tokens and omits empty tokens.The given delimiters string is supposed to consist of any number of delimiter characters. Each of those characters can be used to separate tokens. A delimiter is always a single character; for multi-character delimiters, consider using
delimitedListToStringArrayCopied from the Spring Framework while retaining all license, copyright and author information.
- 参数:
str- the String to tokenizedelimiters- the delimiter characters, assembled as String (each of those characters is individually considered as delimiter).- 返回:
- an array of the tokens
- 另请参阅:
-
tokenizeToStringArray
public static String[] tokenizeToStringArray(String str, String delimiters, boolean trimTokens, boolean ignoreEmptyTokens) Tokenize the given String into a String array via a StringTokenizer.The given delimiters string is supposed to consist of any number of delimiter characters. Each of those characters can be used to separate tokens. A delimiter is always a single character; for multi-character delimiters, consider using
delimitedListToStringArrayCopied from the Spring Framework while retaining all license, copyright and author information.
- 参数:
str- the String to tokenizedelimiters- the delimiter characters, assembled as String (each of those characters is individually considered as delimiter)trimTokens- trim the tokens via String'strimignoreEmptyTokens- omit empty tokens from the result array (only applies to tokens that are empty after trimming; StringTokenizer will not consider subsequent delimiters as token in the first place).- 返回:
- an array of the tokens (
nullif the input String wasnull) - 另请参阅:
-
toStringArray
Copy the given Collection into a String array. The Collection must contain String elements only.Copied from the Spring Framework while retaining all license, copyright and author information.
- 参数:
collection- the Collection to copy- 返回:
- the String array (
nullif the passed-in Collection wasnull)
-