Package ch.autumo.commons.utils.common
Class TextUtils
java.lang.Object
ch.autumo.commons.utils.common.TextUtils
Text Utils.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringescapeHtml(String value) HTML escape value.static StringreplaceAllCharacters(char newChar, String oldChars, String value) Replace all old chars with new char.static String[]replaceAllCharacters(char newChar, String oldChars, String[] values) Replace all old chars with new char in all strings in array.static StringBufferreplaceVariable(StringBuffer input, String variable, String value) Replace a single variable.static StringBuilderreplaceVariable(StringBuilder input, String variable, String value) Replace a single variable.
-
Method Details
-
replaceVariable
Replace a single variable.- Parameters:
input- sourcevariable- variablevalue- value for replacement- Returns:
- new replaced source
-
replaceVariable
Replace a single variable.- Parameters:
input- sourcevariable- variablevalue- value for replacement- Returns:
- new replaced source
-
replaceAllCharacters
Replace all old chars with new char.- Parameters:
newChar- new characteroldChars- all old chars toegether as one stringvalue- value to char replace- Returns:
- new char replaced value
-
replaceAllCharacters
Replace all old chars with new char in all strings in array.- Parameters:
newChar- new characteroldChars- all old chars toegether as one stringvalues- values to replace with char- Returns:
- new char replaced values
-
escapeHtml
HTML escape value.- Parameters:
value- to escape- Returns:
- value escaped value
-