• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

how to remove special characters in a string using pattern matching

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic