Last active
December 14, 2023 10:47
-
-
Save onuryilmaz/6034569 to your computer and use it in GitHub Desktop.
Replace Turkish Characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String clearTurkishChars(String str) { | |
String ret = str; | |
char[] turkishChars = new char[] {0x131, 0x130, 0xFC, 0xDC, 0xF6, 0xD6, 0x15F, 0x15E, 0xE7, 0xC7, 0x11F, 0x11E}; | |
char[] englishChars = new char[] {'i', 'I', 'u', 'U', 'o', 'O', 's', 'S', 'c', 'C', 'g', 'G'}; | |
for (int i = 0; i < turkishChars.length; i++) { | |
ret = ret.replaceAll(new String(new char[]{turkishChars[i]}), new String(new char[]{englishChars[i]})); | |
} | |
return ret; | |
} |
Great work
thanks
Thank you
Tnx!
nice
thanks.
thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice work thx