Package de.eldoria.eldoutilities.utils
Class TextUtil
java.lang.Object
de.eldoria.eldoutilities.utils.TextUtil
Basic text utilities
- Since:
- 1.0.0
-
Method Summary
-
Method Details
-
countChars
Count how often the char was used inside the string.- Parameters:
string- string to checkcount- char to count- Returns:
- the number of occurences of the char in the string.
-
cropText
Trims a text to the desired length. Returns unmodified input if max chars is larger or equal string.length().- Parameters:
string- String to trimendSequence- end sequence which should be append at the end of the string. included in max chars.maxChars- max char length.keepWords- true if no word should be cut.- Returns:
- String with length of maxChars of shorter.
-