Package org.vaadin.miki.util
Class StringTools
java.lang.Object
org.vaadin.miki.util.StringTools
Some general-purpose utils for
Strings.- Since:
- 2022-09-08
- Author:
- miki
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringfirstLetterUppercase(String string) Modifies the text by putting the first character of it to uppercase.static StringhumanReadable(String string) ConvertscamelCaseintoReadable Text.toCharacterSet(char... chars) Converts an array of characters into an ordered set.
-
Method Details
-
firstLetterUppercase
Modifies the text by putting the first character of it to uppercase.- Parameters:
string- String.- Returns:
- The input string, but with the first letter being uppercase.
-
humanReadable
ConvertscamelCaseintoReadable Text. Also removes more than two consecutive spaces and trims the result.- Parameters:
string- String.- Returns:
- Human-readable string.
-
toCharacterSet
Converts an array of characters into an ordered set.- Parameters:
chars- Characters.- Returns:
- A set of characters. Never
null, but possibly empty.
-