aspose file tools*
The moose likes I/O and Streams and the fly likes how to remove special characters in a string using pattern matching 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 » I/O and Streams
Bookmark "how to remove special characters in a string using pattern matching " Watch "how to remove special characters in a string using pattern matching " New topic
Author

how to remove special characters in a string using pattern matching

venu babu.k
Greenhorn

Joined: Nov 09, 2010
Posts: 8

Hi,

This is venu,

Iam trying to find the special character in a string which is not an (a-z,A-Z) character.By using regular expression iam able to find other than (a-z,A-Z) character.
But i want to remove that special character. or any other technique you know.

example:
String str="BayernMünchenAmateure";
here ü must remove.

If any body knows help me............
Thanks in advance
John Pradeep.v
Ranch Hand

Joined: Jul 21, 2008
Posts: 59
Hi Venu,
Instead of finding the special character (black listing) just extract those characters you are interested in... (white listing) this way you dont have to maintain a huge list of special characters.


Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4366
    
    8

In this particular case, though, I'd expect there'd be a need to replace the special characters, not remove them. (E.g. 'ü' to 'u' or 'eu').
venu babu.k
Greenhorn

Joined: Nov 09, 2010
Posts: 8
venu babu.k wrote:
Hi,

This is venu,

Iam trying to find the special character in a string which is not an (a-z,A-Z) character.By using regular expression iam able to find other than (a-z,A-Z) character.
But i want to remove that special character. or any other technique you know.

example:
String str="BayernMünchenAmateure";
here ü must remove.

If any body knows help me............
Thanks in advance




Thanks for your suggestions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to remove special characters in a string using pattern matching