Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4
Hello If you want to use a special character like "\" in a String, just escape it. To escape a character, which mean that it will only be seen as normal text, you use "\". So to escape \, just put a \ before, like that : System.out.print("\\"); => Output : \ (You also have to do it if you want to put a ' or " as text, for exemple : System.out.print("To escape \"\\\" use \\"); => Output : To escape "\" use \ )
1st Feb 2020, 11:41 PM
AriesCat
AriesCat - avatar