March 2019
Intermediate to advanced
242 pages
6h 21m
English
The escape() method will be used to invert the escapes. The following table shows how it will convert the characters:
|
Original character |
Converted character |
|
Less than ' ' (space) |
Unicode or character escape sequences |
|
Above ~ (tilde) |
Unicode escape sequences |
|
" (double quotes) |
Escape sequence |
|
' (single quote) |
Escape sequence |
|
\ (backslash) |
Escape sequence |
The following example doesn't include a newline in the output:
System.out.println("eJava" + "\n".escape() + "Guru");
The output of the preceding code is as follows:
eJava\nGuru
Consider the following code:
System.out.println("eJava" + `•`.escape());
The output of the preceding code is as follows (• is converted to its equivalent ...
Read now
Unlock full access