Package org.n52.shetland.util
Class StringHelper
java.lang.Object
org.n52.shetland.util.StringHelper
Helper class for String objects. Contains methods to join Strings, convert streams to Strings or to check
for null and emptiness.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic StringconvertStreamToString(InputStream is, String charset) static intgetCharacterCount(String s, char character) static intgetCharacterCountIgnoreCase(String s, char character) static Stringstatic String[]splitToArray(String stringToSplit) static String[]splitToArray(String stringToSplit, String separator) splitToList(String string) splitToList(String string, String separator) splitToSet(String stringToSplit) splitToSet(String string, String separator) splitToStream(String string, String separator)
-
Method Details
-
normalize
- Parameters:
toNormalize- the string to normalize- Returns:
- a normalized String for use in a file path, i.e. all [\,/,:,*,?,",<,>,;] characters are replaced by '_'.
-
convertStreamToString
public static String convertStreamToString(InputStream is, @Nullable String charset) throws IOException - Throws:
IOException
-
convertStreamToString
- Throws:
IOException
-
splitToList
-
splitToList
-
splitToSet
-
splitToSet
-
splitToArray
-
splitToArray
-
getCharacterCountIgnoreCase
-
getCharacterCount
-
splitToStream
-