Package gw.internal.gosu.util
Class StringUtil
java.lang.Object
gw.internal.gosu.util.StringUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringBufferTakes a string 'glue' and array of strings, and returns a StringBuffer containing the strings joined with the glue between each of them.static StringBufferTakes 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 <E> StringBufferjoin(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.tokenizeToList(String s, char separator) Split up a string into tokens delimited by the specified separator character.
-
Constructor Details
-
StringUtil
public StringUtil()
-
-
Method Details
-
tokenizeToList
Split up a string into tokens delimited by the specified separator character. If the string is null or zero length, returns null.- Parameters:
s- The String to tokenizeseparator- The character delimiting tokens- Returns:
- A List of String tokens, or null is s is null or 0 length.
-
join
Takes a string 'glue' and array of strings, and returns a StringBuffer containing the strings joined with the glue between each of them. The strings are joined in order *- Parameters:
glue- The glue stringstrings- The strings to join- Returns:
- a StringBuffer
-
join
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. The strings are joined in order- Parameters:
glue- The glue stringstrings- The strings to joinfirst- The index of the first string to joinlast- The index of the last string to join- Returns:
- a StringBuffer
-
join
Takes a string 'glue' and collection of CharSequences, and returns a StringBuffer containing the CharSequences joined with the glue between each of them. They are joined in the order returned by the iterator of the colection- Parameters:
glue- The glue stringcharSequences- The CharSequences to join- Returns:
- a StringBuffer
-