public class StringUtil extends Object
| Constructor and Description |
|---|
StringUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <E> StringBuffer |
join(String glue,
Collection<E> charSequences)
Takes a string 'glue' and collection of CharSequences, and returns a StringBuffer containing the CharSequences
joined with the glue between each of them.
|
static StringBuffer |
join(String glue,
String[] strings)
Takes a string 'glue' and array of strings, and returns a StringBuffer containing the strings joined with the glue
between each of them.
|
static StringBuffer |
join(String glue,
String[] strings,
int first,
int last)
Takes a string 'glue' and array of strings, and returns a StringBuffer containing the strings
between the specified indices (inclusive) joined with the glue between each of them.
|
static List<String> |
tokenizeToList(String s,
char separator)
Split up a string into tokens delimited by the specified separator
character.
|
public static List<String> tokenizeToList(String s, char separator)
s - The String to tokenizeseparator - The character delimiting tokenspublic static StringBuffer join(String glue, String[] strings)
glue - The glue stringstrings - The strings to joinpublic static StringBuffer join(String glue, String[] strings, int first, int last)
glue - The glue stringstrings - The strings to joinfirst - The index of the first string to joinlast - The index of the last string to joinpublic static <E> StringBuffer join(String glue, Collection<E> charSequences)
glue - The glue stringcharSequences - The CharSequences to joinCopyright © 2015. All rights reserved.