• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to remove special characters in a string using pattern matching

 
venu babu.k
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic