Package com.mackenziehigh.sexpr.internal
Class Escaper
java.lang.Object
com.mackenziehigh.sexpr.internal.Escaper
Escaper.
Herein, an escape sequence is any one of the following substrings:
- \b
- \t
- \n
- \f
- \r
- \'
- \"
- \\
- \ uWXYZ, where WXYZ is a four-digit hexadecimal Unicode character code.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionescape
(char[] input) This method creates a string from a char-array, with each special-character replaced with a relevant escape sequence.char[]
This method replaces escape sequences in a string with the equivalent special-characters and then returns the equivalent char-array.
-
Field Details
-
instance
This is the singleton instance of this class.
-
-
Method Details
-
escape
This method creates a string from a char-array, with each special-character replaced with a relevant escape sequence.- Parameters:
input
- will be converted to a string.- Returns:
- the new string.
-
expand
This method replaces escape sequences in a string with the equivalent special-characters and then returns the equivalent char-array.In short, X.equals(expand(escape(X))).
- Parameters:
input
- is an escaped string.- Returns:
- the non-escaped char-array.
-