Package gw.util
Class GosuEscapeUtil
java.lang.Object
gw.util.GosuEscapeUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringescapeForGosuStringLiteral(char ch) static StringescapeForGosuStringLiteral(String strText) static StringescapeForGosuStringLiteral(String strText, int iStart, int iEnd) static StringescapeForHTML(String string) static StringescapeForHTML(String string, boolean escapeWhitespace) static StringescapeForJava(char ch) Converts an escaped character code into a string literal expressing it, e.g.static StringescapeForJava(String string) Escape any special characters in the string, using the Java escape syntax.static StringgetUnicodeEscape(char ch) private static booleanisPrintableAscii(char ch) static String
-
Constructor Details
-
GosuEscapeUtil
public GosuEscapeUtil()
-
-
Method Details
-
escapeForJava
Escape any special characters in the string, using the Java escape syntax. For example any tabs become \t, newlines become \n etc.- Returns:
- the escaped string. Returns the original string unchanged if it contains no special characters.
-
escapeForJava
Converts an escaped character code into a string literal expressing it, e.g. '\n' becomes "\\n".- Parameters:
ch- Escaped character code.- Returns:
- The string expression of the character code, null if
chis not an escaped character. Supports Unicode.
-
escapeForGosuStringLiteral
-
escapeForGosuStringLiteral
-
escapeForGosuStringLiteral
-
isPrintableAscii
private static boolean isPrintableAscii(char ch) -
getUnicodeEscape
-
stripNewLinesAndExtraneousWhiteSpace
-
escapeForHTML
-
escapeForHTML
-