public final class StringUtils extends Object
| Constructor and Description |
|---|
StringUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertCharsToUnicodeChars(String s,
boolean toLowerCase)
Deprecated.
use instead
StringExtensions.toUnicodeChars(String, boolean) |
static byte[] |
convertToBytearray(char[] source)
Converts the given chararray to a bytearray.
|
static char[] |
convertToCharArray(byte[] source)
Convert the given byte array to char array.
|
static Character |
convertUnicodeStringToCharacter(String theUnicodeString)
Converts the given unicode String object to character object.
|
static byte[] |
decodeHex(char[] data)
Decode hex.
|
static char[] |
encodeHex(byte[] data)
Encode hex.
|
static String |
getAttributName(String name)
Gets the Attribut-name without brackets.
|
static String |
getIndex(String name)
Gets the first index from the brackets.
|
static String |
getItemNumber(String name)
Gets the ItemNumber from the String name.
|
static String |
getLastCharacter(String str)
Deprecated.
use instead
StringExtensions.lastCharacter(String) |
static String |
getStringAfterUnderscore(String element)
The Method getStringAfterUnderscore(String) gets the substring after the first underscore.
|
static String |
getStringBeforeUnderscore(String element)
The Method getStringBeforeUnderscore(String) gets the substring before the first underscore.
|
static String |
getValue(Map<String,String> data,
String key,
String defaultValue)
Gets the value from the given map and if it does not exist or is empty the given default
value will be returned.
|
static boolean |
isNullOrEmpty(String str)
Deprecated.
use instead
StringExtensions.isNullOrEmpty(String) |
static boolean |
isNumber(String testString)
Deprecated.
use instead
StringExtensions.isNumber(String) |
static String |
putQuotesToString(String s)
Deprecated.
use instead
StringExtensions.addDoubleQuotationMarks(String) |
static String |
readLine(String stringWithCarriageReturns)
Reads the given String till it finds a carriage return and returns it.
|
static String[] |
removeEmptyString(String[] words)
Removes empty Strings from the given string array and gives it back.
|
static String |
removeNewlineCharacters(String subject)
Removes the newline characters from the given String.
|
static String |
removeQuotationMarks(String s)
Deprecated.
use instead
StringExtensions.addDoubleQuotationMarks(String) |
static String |
replaceAll(String original,
String[] findString,
String replaceWith)
Replaces all occurrences of a String within another String.
|
static String |
replaceAll(String original,
String findString,
String replaceWith)
Replaces all occurrences of a String within another String.
|
static String |
replaceEach(String input,
String searchRegexPattern,
String replace)
Replace each occurences from the search pattern(regex) with the given replace String of the
given input String.
|
static String |
setFirstCharacterToLowerCase(String fieldName)
Deprecated.
|
static String |
setFirstCharacterToUpperCase(String fieldName)
Deprecated.
|
static char |
toHex(int i)
To hex.
|
static String |
toUnicode(String toUnicode,
boolean toLowerCase)
Converts all characters from the given String to unicodes characters encoded like \uxxxx.
|
@Deprecated public static String convertCharsToUnicodeChars(String s, boolean toLowerCase)
StringExtensions.toUnicodeChars(String, boolean)s - The String to convert.toLowerCase - If true the letters from the unicode characters are lower case.public static final byte[] convertToBytearray(char[] source)
source - the source.public static char[] convertToCharArray(byte[] source)
source - the source.public static Character convertUnicodeStringToCharacter(String theUnicodeString)
theUnicodeString - the the unicode stringpublic static byte[] decodeHex(char[] data)
throws org.apache.commons.codec.DecoderException
data - the dataorg.apache.commons.codec.DecoderException - the decoder exceptionpublic static char[] encodeHex(byte[] data)
data - the datapublic static final String getAttributName(String name)
name - The name with brackets.public static final String getIndex(String name)
name - The name from the Attributepublic static final String getItemNumber(String name)
name - the name@Deprecated public static String getLastCharacter(String str)
StringExtensions.lastCharacter(String)str - the strpublic static final String getStringAfterUnderscore(String element)
element - The element to get the substing.public static final String getStringBeforeUnderscore(String element)
element - The element to get the substing.public static String getValue(Map<String,String> data, String key, String defaultValue)
data - the datakey - the keydefaultValue - the default value@Deprecated public static final boolean isNullOrEmpty(String str)
StringExtensions.isNullOrEmpty(String)str - The String to check.@Deprecated public static final boolean isNumber(String testString)
StringExtensions.isNumber(String)testString - The String to check.@Deprecated public static final String putQuotesToString(String s)
StringExtensions.addDoubleQuotationMarks(String)s - The String to handle.public static final String readLine(String stringWithCarriageReturns)
stringWithCarriageReturns - The String.public static String[] removeEmptyString(String[] words)
words - The string array to remove empty strings.public static String removeNewlineCharacters(String subject)
subject - the subject@Deprecated public static final String removeQuotationMarks(String s)
StringExtensions.addDoubleQuotationMarks(String)s - The String to handle.public static final String replaceAll(String original, String findString, String replaceWith)
original - The String to search.findString - The search pattern.replaceWith - Replace with that String.public static final String replaceAll(String original, String[] findString, String replaceWith)
original - The String to search.findString - An array with search patterns.replaceWith - Replace with that String.public static String replaceEach(String input, String searchRegexPattern, String replace)
input - the input String that will be changed.searchRegexPattern - the search regex patternreplace - the String to replace with.@Deprecated public static final String setFirstCharacterToLowerCase(String fieldName)
StringExtensions.firstCharacterToLowerCase(String)fieldName - The String to modify.@Deprecated public static final String setFirstCharacterToUpperCase(String fieldName)
StringExtensions.firstCharacterToUpperCase(String)fieldName - The String to modify.public static char toHex(int i)
i - the ipublic static String toUnicode(String toUnicode, boolean toLowerCase)
toUnicode - The String to convert.toLowerCase - If true the letters from the unicode characters are lower case.Copyright © 2007–2015 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.