public class StringUtil
extends java.lang.Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
escapeProperty(char chr)
Returns an escaped property file value for the specified input
character.
|
static java.lang.String |
escapeProperty(java.lang.String str)
Returns an escaped property file value for the specified input
string.
|
static java.lang.String |
escapeXml(char chr)
Returns properly escaped XML for the specified input character.
|
static java.lang.String |
escapeXml(java.lang.String str)
Returns properly escaped XML for the specified input string.
|
static java.lang.String |
first(java.lang.String str1,
java.lang.String str2,
java.lang.String str3)
Returns the first non-empty value of the argument strings.
|
static boolean |
isAscii(char c)
Checks if a character belongs to the printable ASCII set.
|
static boolean |
isAscii(java.lang.String str)
Checks if all characters in a string belongs to the printable
ASCII set.
|
static boolean |
isIsoLatin1(char c)
Checks if a character belongs to the printable ISO-8859-1
set.
|
static boolean |
isIsoLatin1(java.lang.String str)
Checks if all characters in a string belongs to the printable
ISO-8859-1 set.
|
static boolean |
isNumber(char c)
Checks if a character is a numeric ASCII character.
|
static boolean |
isNumber(java.lang.String str)
Checks if all characters in a string are numeric ASCII
characters.
|
static java.lang.String |
match(java.lang.String str,
java.util.regex.Pattern re)
Returns the first match of a regular expression from a string.
|
static java.lang.String |
toHex(char chr)
Returns a 4 digit hexadecimal representation of a character.
|
public static boolean isAscii(char c)
c
- the character to checkpublic static boolean isAscii(java.lang.String str)
str
- the string to checkpublic static boolean isIsoLatin1(char c)
c
- the character to checkpublic static boolean isIsoLatin1(java.lang.String str)
str
- the string to checkpublic static boolean isNumber(char c)
c
- the character to checkpublic static boolean isNumber(java.lang.String str)
str
- the string to checkpublic static java.lang.String toHex(char chr)
chr
- the character to convertpublic static java.lang.String escapeProperty(char chr)
chr
- the character to convertpublic static java.lang.String escapeProperty(java.lang.String str)
str
- the string to convertpublic static java.lang.String escapeXml(char chr)
chr
- the character to convertpublic static java.lang.String escapeXml(java.lang.String str)
str
- the string to convertpublic static java.lang.String first(java.lang.String str1, java.lang.String str2, java.lang.String str3)
str1
- the first string to checkstr2
- the second string to checkstr3
- the third string to checkpublic static java.lang.String match(java.lang.String str, java.util.regex.Pattern re)
str
- the string to matchre
- the compiled regular expression