|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectme.grison.jtoml.Util.TomlString
public static class Util.TomlString
Toml String Utilities.
Note: This is to avoid dependency on Apache commons for such limited features.
| Constructor Summary | |
|---|---|
Util.TomlString()
|
|
| Method Summary | |
|---|---|
static int |
countOccurrences(String str,
String needle)
Counts the number of occurrences of a String in an other String. |
static String |
escape(String input)
Escapes a list of literals found in the given String. |
static String |
unescape(String input)
Unescape a list of literals found in the given String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Util.TomlString()
| Method Detail |
|---|
public static String unescape(String input)
'\' + 't', '\' + 'n', ...) to there equivalent ('\t', '\n').
'\' + '0' -> '\0' null character (0x00)'\' + 't' -> '\t' tab character (0x09)'\' + 'n' -> '\n' newline character (0x0a)'\' + 'r' -> '\r' carriage return character (0x0d)'\' + '"' -> '"' quote character (0x22)'\' + '\' -> '\' backslash character (0x5c)
input - the String to unescape
public static String escape(String input)
'\t', '\n', ...) to there equivalent ('\' + 't', '\' + 'n').
'\0' null character (0x00) -> '\' + '0''\t' tab character (0x09) -> '\' + 't''\n' newline character (0x0a) -> '\' + 'n''\r' carriage return character (0x0d) -> '\' + 'r''\"' quote character (0x22) -> '\' + '"' '\\' backslash character (0x5c) -> '\' + '\'
input - the String to escape
public static int countOccurrences(String str,
String needle)
str - the String to search in.needle - the String to count the occurrences of.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||