public class StringUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DOUBLE_REGEX
The pattern of a double value.
|
static String |
DOUBLE_REGEX_WITH_NAN
The pattern of a double value.
|
static String |
QUOTED_STRING_REGEX
The pattern of a string, including double quotes.
|
static String |
SINGLEQUOTED_STRING_REGEX
The pattern of a string using single quotes.
|
static String |
STRING_ESCAPE_SEQUENCE_REGEX
The pattern of a string fragment with escape sequences.
|
Modifier and Type | Method and Description |
---|---|
static List<Object> |
parseCSVLine(String line,
String separatorRegex)
Parses a line of text representing comma separated values and returns
the values themselves.
|
static String |
unescapeString(String escapedString)
Takes an escaped string and returns the unescaped version
|
static String |
unquote(String quotedString)
Takes a single quoted or double quoted String and returns the unquoted
and unescaped version of the string.
|
public static final String STRING_ESCAPE_SEQUENCE_REGEX
public static final String QUOTED_STRING_REGEX
public static final String SINGLEQUOTED_STRING_REGEX
public static final String DOUBLE_REGEX
public static final String DOUBLE_REGEX_WITH_NAN
public static String unquote(String quotedString)
quotedString
- the original stringpublic static String unescapeString(String escapedString)
escapedString
- the original stringpublic static List<Object> parseCSVLine(String line, String separatorRegex)
line
- the line to parseseparatorRegex
- the regular expression for the separatorCopyright © 2015. All rights reserved.