Package gw.internal.gosu.util
Class StringUtil
- java.lang.Object
-
- gw.internal.gosu.util.StringUtil
-
public class StringUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description StringUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringBufferjoin(java.lang.String glue, java.lang.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 java.lang.StringBufferjoin(java.lang.String glue, java.lang.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 <E> java.lang.StringBufferjoin(java.lang.String glue, java.util.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 java.util.List<java.lang.String>tokenizeToList(java.lang.String s, char separator)Split up a string into tokens delimited by the specified separator character.
-
-
-
Method Detail
-
tokenizeToList
public static java.util.List<java.lang.String> tokenizeToList(java.lang.String s, char separator)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
public static java.lang.StringBuffer join(java.lang.String glue, java.lang.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. The strings are joined in order *- Parameters:
glue- The glue stringstrings- The strings to join- Returns:
- a StringBuffer
-
join
public static java.lang.StringBuffer join(java.lang.String glue, java.lang.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. 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
public static <E> java.lang.StringBuffer join(java.lang.String glue, java.util.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. 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
-
-