- java.lang.Object
-
- ch.bind.philib.lang.StringUtil
-
public abstract class StringUtil extends Object
- Author:
- Philipp Meinen
-
-
Field Summary
Fields Modifier and Type Field Description static String[]EMPTY_STRING_ARRAY
-
Constructor Summary
Constructors Modifier Constructor Description protectedStringUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcount(String str, int value)Counts the number of times the character with the given unicodevalueoccurs.static StringextractBack(String s, char delim)static String[]split(String str, int delimiter)Splits a string by a given unicodedelimiter.
-
-
-
Field Detail
-
EMPTY_STRING_ARRAY
public static final String[] EMPTY_STRING_ARRAY
-
-
Method Detail
-
count
public static int count(String str, int value)
Counts the number of times the character with the given unicodevalueoccurs.- Parameters:
str- the input string, may be null or emptyvalue- the unicode value to search for- Returns:
- the number of times the given unicode
valueoccurs.
-
split
public static String[] split(String str, int delimiter)
Splits a string by a given unicodedelimiter.- Parameters:
str- the input string, may be null or emptydelimiter- the delimiter to use- Returns:
- A string array with the different parts of the string after splitting it. The returned array is never null but may be empty (length 0). However, none of the returned values is empty.
-
-