public final class StringFunctions
extends java.lang.Object
Constructor and Description |
---|
StringFunctions() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addCheckDigit(java.lang.String value)
Returns the given value plus check digit
|
static int |
addCheckDigitModulo10(int number)
Returns the Modulo10 check digit extended number.
|
static java.lang.String |
addCheckDigitModulo11(java.lang.String nbrString)
Returns the Modulo11 check digit extended number.
|
static int |
count(java.lang.String stringToCheck,
char charToCount) |
static java.lang.String |
decreaseDigits(java.lang.String digits,
int amount) |
static java.lang.String |
extractDigitPart(java.lang.String combinedExpr) |
static java.lang.String |
fixLength(java.lang.String value,
int length)
Brings a String to fix length as needed in older languages like Cobol or databases like ucanaccess.
|
static java.lang.String |
getContentBetween(java.lang.String line,
java.lang.String from,
java.lang.String until,
int starting) |
static java.lang.String[] |
getElements(java.lang.String separatedString,
java.lang.String separator)
Returns elements from a String with separators.
|
static java.lang.String[] |
getElementsWithMultipleSeparators(java.lang.String string,
java.lang.String separators)
Returns elements from a String with multiple separators.
|
static java.lang.String |
getExtension(java.lang.String fileName) |
static java.lang.String |
getSearchValue(java.lang.String theString)
Returns the value to search ignoring all accents.
|
static java.lang.String |
getSearchValue(java.lang.String theString,
int limit)
Returns the value to search ignoring all accents.
|
static java.lang.String |
getSortValue(java.lang.String theString) |
static java.lang.String |
getSortValue(java.lang.String theString,
int limit)
Returns the sort order value of the specified string
|
static java.lang.String[] |
getStringLines(java.lang.String stringWithLineFeed) |
static java.lang.String |
getUrlParam(java.lang.String url,
java.lang.String param) |
static java.lang.String[] |
getWordWrappedStringLines(java.lang.String stringToWrap,
int maxChars) |
static java.lang.String |
increaseDigits(java.lang.String digits) |
static boolean |
isOf(java.lang.String stringToCheck,
char[] validChars) |
static java.lang.String |
optimizeNumberList(java.util.Vector<java.lang.String> numbers)
Shortens a list of numbers by uniting numbers in sequence
|
static java.lang.String |
replaceAll(java.lang.String stringToManipulate,
java.lang.String stringToReplace,
java.lang.String replaceString) |
static java.lang.String |
replaceUmlaute(java.lang.String theString) |
static java.lang.String |
rtrim(java.lang.String value)
Returns a right trimmed String.
|
static boolean |
seemsToBeCapsLock(char input)
Returns true if (digit) input (e.g. by bar code reader) seems to be foiled by caps lock
|
static boolean |
seemsToBeCapsLock(java.lang.String input)
Returns true if (digit) input (e.g. by bar code reader) seems to be foiled by caps lock
|
public static java.lang.String getSortValue(java.lang.String theString)
public static java.lang.String getSortValue(java.lang.String theString, int limit)
theString
- the string whose sort order is to buildlimit
- the max length of the result stringpublic static java.lang.String getSearchValue(java.lang.String theString)
theString
- to be simplified by e.g. removing accentspublic static java.lang.String getSearchValue(java.lang.String theString, int limit)
theString
- to be simplified by e.g. removing accentslimit
- the max length of the result stringpublic static java.lang.String replaceUmlaute(java.lang.String theString)
public static boolean isOf(java.lang.String stringToCheck, char[] validChars)
public static java.lang.String[] getStringLines(java.lang.String stringWithLineFeed)
public static java.lang.String[] getElementsWithMultipleSeparators(java.lang.String string, java.lang.String separators)
string
- the String to parse.separators
- the separators to use.public static java.lang.String[] getElements(java.lang.String separatedString, java.lang.String separator)
separatedString
- the String to parse.separator
- the separator to use.public static java.lang.String replaceAll(java.lang.String stringToManipulate, java.lang.String stringToReplace, java.lang.String replaceString)
public static java.lang.String[] getWordWrappedStringLines(java.lang.String stringToWrap, int maxChars)
public static java.lang.String getExtension(java.lang.String fileName)
public static int count(java.lang.String stringToCheck, char charToCount)
public static java.lang.String rtrim(java.lang.String value)
value
- the String to be trimmedpublic static java.lang.String fixLength(java.lang.String value, int length)
value
- the value to be formattedlength
- the target lengthpublic static java.lang.String addCheckDigit(java.lang.String value)
value
- the value which should be extended by check digitpublic static int addCheckDigitModulo10(int number)
number
- the number to be extendedpublic static java.lang.String addCheckDigitModulo11(java.lang.String nbrString)
number
- the number to be extendedpublic static java.lang.String optimizeNumberList(java.util.Vector<java.lang.String> numbers)
numbers
- the numbers to build the listpublic static java.lang.String extractDigitPart(java.lang.String combinedExpr)
public static java.lang.String increaseDigits(java.lang.String digits)
public static java.lang.String decreaseDigits(java.lang.String digits, int amount)
public static boolean seemsToBeCapsLock(java.lang.String input)
input
- the input data to checkpublic static boolean seemsToBeCapsLock(char input)
input
- the input data to checkpublic static java.lang.String getContentBetween(java.lang.String line, java.lang.String from, java.lang.String until, int starting)
public static java.lang.String getUrlParam(java.lang.String url, java.lang.String param)
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de