Modifier and Type | Method and Description |
---|---|
static char |
escape(char ch)
Returns the escaped representation of the specified character.
|
static boolean |
isEscapable(char ch)
Tests whether the specified character is escapable.
|
static boolean |
isPrintable(char ch)
Tests whether the specified character is printable.
|
static String |
toString(char ch) |
public static String toString(char ch)
public static char escape(char ch)
Note: This method only supports single-character escape sequences, and therefore does not handle 2-digit or 3-digit octal escape sequences, or 4-hex-digit unicode sequences.
Escape Sequences Escape Sequence Description \t
Tab \b
Backspace \n
Newline \r
Carriage return \f
Formfeed \'
Single quote \"
Double quote \\
Backslash \0
0 \1
1 \2
2 \3
3 \4
4 \5
5 \6
6 \7
7
ch
- The character to escape.IllegalArgumentException
- If the specified character is not escapable.public static boolean isEscapable(char ch)
Note: This method only supports single-character escape sequences, and therefore does not handle 2-digit or 3-digit octal escape sequences, or 4-hex-digit unicode sequences.
Escape Sequences Escape Sequence Description \t
Tab \b
Backspace \n
Newline \r
Carriage return \f
Formfeed \'
Single quote \"
Double quote \\
Backslash \0
0 \1
1 \2
2 \3
3 \4
4 \5
5 \6
6 \7
7
ch
- The character to test.true
if the specified character is escapable.public static boolean isPrintable(char ch)
ch
- The character to test.true
if the specified character is printable.Copyright © 2020 LibJ. All rights reserved.