| Author |
how to use \ in a string
|
Cody Long
Ranch Hand
Joined: Jan 01, 2009
Posts: 95
|
|
|
i cannot use the \ backslash in a string. when i compile it gives a "illegal escape character" error. i tried to use '\' and then it just displayed quotes. any suggestions?
|
Duct tape is like the Force. It has a dark side, a light side, and it binds the whole universe together.
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
See this thread...
http://www.coderanch.com/t/460417/Beginning-Java/java/help-please-PLEASE
|
 |
Cody Long
Ranch Hand
Joined: Jan 01, 2009
Posts: 95
|
|
|
thanks
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56227
|
|
|
Which is a great example of why descriptive subject are helpful, and non-descriptive ones are not.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Deepika Singh
Greenhorn
Joined: Oct 10, 2008
Posts: 21
|
|
you have to use "\\" to print "\"
String s2 = "I have to write backslash \\";
|
 |
 |
|
|
subject: how to use \ in a string
|
|
|