ios - Is there a way to convert special characters to normal characters in Swift? -


this question has answer here:

suppose have string value special accents :

éáüîāṁṇār̥ 

is there universal/dynamic way convert/strip these types of characters down basic formatting ?..

eauiamnar 

use stringbyfoldingwithoptions , pass .diacriticinsensitivesearch

let s = "éáüîāṁṇār̥" let r = s.stringbyfoldingwithoptions(.diacriticinsensitivesearch, locale: nil) print(r) // prints eauiamnar 

Comments

Popular posts from this blog

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

javascript - return highlighted cells to php -

java - Creating a room by reading from a file (for a game) -