Class StringEscaper
java.lang.Object
dev.toonformat.jtoon.util.StringEscaper
Handles string escaping for TOON format.
Escapes special characters that need protection in quoted strings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringEscapes special characters in a string.static StringUnescapes a string and removes surrounding quotes if present.static voidvalidateString(String value) Validates a quoted string for invalid escape sequences and unterminated strings.
-
Method Details
-
escape
-
validateString
Validates a quoted string for invalid escape sequences and unterminated strings.- Parameters:
value- The string to validate- Throws:
IllegalArgumentException- if the string has invalid escape sequences or is unterminated
-
unescape
Unescapes a string and removes surrounding quotes if present. Reverses the escaping applied byescape(String).- Parameters:
value- The string to unescape (may be quoted)- Returns:
- The unescaped string with quotes removed
-