Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

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
 
This looks like a job for .... legal tender! It says so right in this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic