Link to home
Start Free TrialLog in
Avatar of petersego
petersego

asked on

How do I strip string for specific characters

I have a string entered dynamically, that I want to strip for any characters, that is not english. Example: Jürgen should be Jrgen.
How would I do that.
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Why not Jurgen or Juergen
Anyway
str = str.replace(/[^a-zA-Z]/g,"")
Avatar of petersego
petersego

ASKER

Because I dont know what special characters might be used. There might be dozens of unknown characters like ê, ë, õ, æ and I cant make rules for everyone.
But if its possible I would love it.
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, you are right about the replacement rules - too. Thanks a lot.