aspose file tools
The moose likes Java in General and the fly likes Non-Alphanumeric Characters in a String Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply 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. <br />Teach a man to fish, he'll drink all your beer.<br /> <br />Cheers,<br /> <br />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
 
Similar Threads
anchor tag and passing a variable
Regex
url sometimes we use / or \ difference
getting problem in converting the backward slash to forward slash
String replaceAll method removes backslashes in replacement string