Skip to content

Instantly share code, notes, and snippets.

@onuryilmaz
Last active December 14, 2023 10:47
Show Gist options
  • Save onuryilmaz/6034569 to your computer and use it in GitHub Desktop.
Save onuryilmaz/6034569 to your computer and use it in GitHub Desktop.
Replace Turkish 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;
}
@samirsamedov
Copy link

Nice work thx

@mehmetbalbay
Copy link

Great work

@Deniz97
Copy link

Deniz97 commented Sep 11, 2020

thanks

@admblbl
Copy link

admblbl commented Mar 3, 2021

Thank you

@mstfymrtc
Copy link

Tnx!

@yunus-sen
Copy link

nice

@emrahalcicek
Copy link

thanks.

@coderkan
Copy link

thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment