public final class StringUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
integerToBinString(int aValue,
int aFieldWidth)
converts an integer to a bin string with leading zeros
|
static String |
integerToHexString(int aValue,
int aFieldWidth)
converts an integer to a hex string with leading zeros
|
static boolean |
isEmpty(String aValue)
Returns whether the given string is actually empty, meaning
null or an empty string. |
static String[] |
tokenize(String aInput,
String aDelimiters)
Tokenizes a given input stream and breaks it into parts on the given
delimiters.
|
static String[] |
tokenizeQuotedStrings(String aInput,
String aDelimiters)
Tokenizes a given input stream and breaks it into parts on the given
delimiters.
|
static String |
unquote(String aInput)
Removes all double quotes from the given input.
|
static String |
unquote(String aInput,
char aQuoteChar)
Removes all quotes, denoted by the given character, from the given input.
|
public static String integerToBinString(int aValue, int aFieldWidth)
aValue
- integer value for conversionaFieldWidth
- number of charakters in fieldpublic static String integerToHexString(int aValue, int aFieldWidth)
aValue
- integer value for conversionaFieldWidth
- number of charakters in fieldpublic static boolean isEmpty(String aValue)
null
or an empty string.aValue
- the string value to check for "emptyness", can be
null
.true
if the given string is empty, false
otherwise.public static String[] tokenize(String aInput, String aDelimiters)
aInput
- the input string to tokenize, can be null
;aDelimiters
- the delimiter characters to break the given input on,
cannot be null
.null
if
the original input was null
.public static String[] tokenizeQuotedStrings(String aInput, String aDelimiters)
aInput
- the input string to tokenize, can be null
;aDelimiters
- the delimiter characters to break the given input on,
cannot be null
.null
if
the original input was null
.public static String unquote(String aInput)
aInput
- the input string to remove the quotes from, may be
null
.null
if
the original input was null
.unquote(String, char)
public static String unquote(String aInput, char aQuoteChar)
aInput
- the input string to remove the quotes from, may be
null
;aQuoteChar
- the quote character to remove.null
if
the original input was null
. If the given input
contained leading and/or trailing whitespace, it is removed from
the result.Copyright © 2015 L'Xtreme IT consultancy. All rights reserved.