public class StringNormalizer extends Object
Modifier and Type | Field and Description |
---|---|
static Pattern |
NON_PRINTABLE_CHARACTER
matches every character that is a control character (\p{Cc}, a unicode general category) and not tab (\t),
carriage return (\r) or new line (\n)
|
Constructor and Description |
---|
StringNormalizer() |
Modifier and Type | Method and Description |
---|---|
static String |
normalize(String input)
Removes the following characters from the given string:
! " § $ % & / ( ) = ? ´ { [ ] } \ ` + - * % : , ; < > ° ^ # ~ ' | Additionally, all diacritics are removed from the string. Finally, it replaces german umlauts ( ä ö ü ß) with their two-letter representations (ae oe ue ss). |
static String |
removeNonPrintableCharacters(String value)
Removes all non-printable characters from the given string.
|
static String |
replaceNonPrintableCharacters(String value,
String replacement)
Replaces all non-printable characters of the given string with the given replacement
|
public static final Pattern NON_PRINTABLE_CHARACTER
public static final String normalize(String input)
! " § $ % & / ( ) = ? ´ { [ ] } \ ` + - * % : , ; < > ° ^ # ~ ' |
input
- the input stringpublic static String removeNonPrintableCharacters(String value)
value
- the stringpublic static String replaceNonPrintableCharacters(String value, String replacement)
value
- the stringreplacement
- the replacement stringCopyright © 2011–2020 aiticon GmbH. All rights reserved.