Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do I strip string for specific characters

Posted on 2011-02-15
5
Medium Priority
?
380 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:petersego
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 34904385
Why not Jurgen or Juergen
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 34904480
Anyway
str = str.replace(/[^a-zA-Z]/g,"")
0
 

Author Comment

by:petersego
ID: 34904491
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.
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 34904530
I would find a page with some standard replacement rules.
Off the top of my head:

ö,ø => oe
ä,æ => ae
å => aa
ü => ue
èéë => e

then there are some language specific ones, like ÿ in Dutch can be ij
http://en.wikipedia.org/wiki/Diacritic

But perhaps more important WHY do you want to replace? If everything is in UTF8, then no need to
0
 

Author Closing Comment

by:petersego
ID: 34904551
Yes, you are right about the replacement rules - too. Thanks a lot.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question