permaculture playing cards*
The moose likes Java in General and the fly likes Non-Alphanumeric Characters in a String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Non-Alphanumeric Characters in a String" Watch "Non-Alphanumeric Characters in a String" New topic
Author

Non-Alphanumeric Characters in a String

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
I understand if we have a non-alphanumeric character in a String, we have to put a backward slash in front of that character. For example, we have to put a backward slach in front of a "backward slash". Eg. we do \\ to put a backward slash in a String.

What about a dot (.) or a dash (-)? Do we have to do the same thing?
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 804
Most punctuation does not need to be escaped. (That's what it's called when you put a backslash in front of a character.)

A few that do are the backslash itself (\\) and the quotation marks (\").


Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Non-Alphanumeric Characters in a String