Package de.kosmos_lab.utils
Class StringFunctions
- java.lang.Object
-
- de.kosmos_lab.utils.StringFunctions
-
public class StringFunctions extends Object
-
-
Constructor Summary
Constructors Constructor Description StringFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringdecompose(String s)static StringfilterFilename(String input)static StringfilterName(String input)removes anything from the text that is not alphanumericstatic Stringformat(String format, Object[][] values)static Stringformat(String format, Map<String,Object> values)static StringgenerateRandomKey()Generate random key.static StringgenerateRandomKey(int len)Generate random key.static HashSet<String>getListOfString(LinkedList<HashSet<String>> wordList)static booleanidentical(Set<String> set, String[] list)static StringreplaceEverythingButNumbers(String text)static StringtoCamelCase(String input)camelcases the input, ie "to camel case" will yield "toCamelCase"static Stringtrim(String input)trims away space and comma at the beginning and end and also removes double spacingstatic Stringtrim(String input, char[] chrs)trims away any given characters, also removes double spacesstatic StringtrimDoubleSpaces(String input)trims away double spaces
-
-
-
Method Detail
-
filterName
@Nonnull public static String filterName(@Nonnull String input)
removes anything from the text that is not alphanumeric- Parameters:
input- any inputtext- Returns:
- the text with everything but Alphanumerics and spaces stripped
-
generateRandomKey
@Nonnull public static String generateRandomKey()
Generate random key.- Returns:
- the string
-
generateRandomKey
@Nonnull public static String generateRandomKey(int len)
Generate random key.- Returns:
- the string
-
getListOfString
@Nonnull public static HashSet<String> getListOfString(@Nonnull LinkedList<HashSet<String>> wordList)
-
replaceEverythingButNumbers
@Nonnull public static String replaceEverythingButNumbers(@Nonnull String text)
-
toCamelCase
@Nullable public static String toCamelCase(@CheckForNull String input)
camelcases the input, ie "to camel case" will yield "toCamelCase"- Parameters:
input- the string to camelcase- Returns:
- the camelcased string
-
trim
@Nullable public static String trim(@CheckForNull String input)
trims away space and comma at the beginning and end and also removes double spacing- Parameters:
input- the input to trim- Returns:
- the trimmed input
-
trim
@Nullable public static String trim(@CheckForNull String input, char[] chrs)
trims away any given characters, also removes double spaces- Parameters:
input- the inputchrs- the array of characters to remove- Returns:
- the trimmed input
-
trimDoubleSpaces
@Nonnull public static String trimDoubleSpaces(@Nonnull String input)
trims away double spaces- Parameters:
input- the input to trim- Returns:
- the trimmed string
-
-