开发者

Replace diacritic letters with equivalent

I'm trying to replace:

á, ă, â ... with a

í, ì, ĭ, î, ǐ, ï, ḯ ... with i

ú, ü ... with u

And so on.

What I am doing now is this: str.replace(/[íìĭîǐïḯ开发者_如何转开发]/gi,'i'.

Also, if I want to match all of them I need to call replace for each grouping.

Is there a better way of doing this?


As far as I know you have to match each group. Take a look into this example, although it is javascript it's very complete script and easy to get it to work in actionscript: http://lehelk.com/2011/05/06/script-to-remove-diacritics/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜