+ 1

What does it mean it should be escaped ??

5th Jun 2017, 2:23 PM
Valeria Lopez Lizarraga
Valeria Lopez Lizarraga - avatar
3 ответов
+ 4
There are some special characters which should be escaped if we want to use them in strings. For example, when we want to define path to a file we can't just write String path = "c:\Temp\file.txt"; because \ character should be escaped as follows: String path = "c:\\Temp\\file.txt"; Another example: Let us assume we need to output "To be or not to be". Here, the double quote charachters should be escaped: System.out.print("\"To be or not to be\"");
5th Jun 2017, 2:35 PM
Aibek T.
Aibek T. - avatar
+ 15
When you want a special character to be considered a normal one you have to escape it (put a "\" backslash before it.). Mostly used in RegEx...
5th Jun 2017, 2:35 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 2
thanks guys , I got it
5th Jun 2017, 2:57 PM
Valeria Lopez Lizarraga
Valeria Lopez Lizarraga - avatar