Class StringUtil
- java.lang.Object
-
- net.automatalib.common.util.string.StringUtil
-
-
Method Summary
-
-
-
Method Detail
-
enquote
public static void enquote(String s, Appendable a) throws IOException
- Throws:
IOException
-
getIdentifierPattern
public static Pattern getIdentifierPattern()
-
enquoteIfNecessary
public static void enquoteIfNecessary(String s, Appendable a) throws IOException
- Throws:
IOException
-
enquoteIfNecessary
public static void enquoteIfNecessary(String s, Appendable a, Pattern valid) throws IOException
- Throws:
IOException
-
enquoteIfNecessary
public static void enquoteIfNecessary(String s, Appendable a, Pattern valid, Pattern exception) throws IOException
- Throws:
IOException
-
unquote
public static void unquote(String s, Appendable a) throws IOException
- Throws:
IOException
-
unescapeQuotes
public static String unescapeQuotes(String s)
Unescapes escaped double quotes in a string, i.e. replaces\"
by"
and\\
by\
.- Parameters:
s
- the string in which to unescape double quotes.- Returns:
- the unescaped string.
-
unescapeQuotes
public static void unescapeQuotes(String s, Appendable a) throws IOException
- Throws:
IOException
-
escapeQuotes
public static String escapeQuotes(String s)
Escapes double quotes in a string. Effectively,"
is replaced by\"
and\
is replaced by\\
.- Parameters:
s
- the string to escape.- Returns:
- the escaped string.
-
escapeQuotes
public static void escapeQuotes(String s, Appendable a) throws IOException
- Throws:
IOException
-
appendArray
public static void appendArray(Appendable a, Object[] array, String sepString) throws IOException
- Throws:
IOException
-
appendArrayEnquoted
public static void appendArrayEnquoted(Appendable a, Object[] array, String sepString) throws IOException
- Throws:
IOException
-
appendIterable
public static void appendIterable(Appendable a, Iterable<?> it, String sepString) throws IOException
- Throws:
IOException
-
appendIterableEnquoted
public static void appendIterableEnquoted(Appendable a, Iterable<?> it, String sepString) throws IOException
- Throws:
IOException
-
appendObject
public static void appendObject(Appendable a, @Nullable Object obj) throws IOException
- Throws:
IOException
-
-