Package org.apache.tomcat.util.buf
Class StringUtils
java.lang.Object
org.apache.tomcat.util.buf.StringUtils
Utility methods to build a separated list from a given set (not java.util.Set) of inputs and return that list as a
string or append it to an existing StringBuilder. If the given set is null or empty, an empty string will be
returned.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
join
(Iterable<String> iterable, char separator, StringBuilder sb) static <T> void
join
(Iterable<T> iterable, char separator, Function<T, String> function, StringBuilder sb) static String
static void
join
(String[] array, char separator, StringBuilder sb) static String
static String
join
(Collection<String> collection) static String
join
(Collection<String> collection, char separator) static <T> void
join
(T[] array, char separator, Function<T, String> function, StringBuilder sb) static String[]
Splits a comma-separated string into an array of String values.
-
Method Details
-
join
-
join
-
join
-
join
-
join
-
join
-
join
public static <T> void join(T[] array, char separator, Function<T, String> function, StringBuilder sb) -
join
public static <T> void join(Iterable<T> iterable, char separator, Function<T, String> function, StringBuilder sb) -
splitCommaSeparated
Splits a comma-separated string into an array of String values. Whitespace around the commas is removed. Null or empty values will return a zero-element array.- Parameters:
s
- The string to split by commas.- Returns:
- An array of String values.
-