mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-26 22:14:08 +08:00
Format code with prettier (#3375)
This commit is contained in:
@ -29,13 +29,40 @@ public class TurkishToLatinConversion {
|
||||
* @return String
|
||||
*/
|
||||
public static String convertTurkishToLatin(String param) {
|
||||
char[] turkishChars
|
||||
= new char[]{0x131, 0x130, 0xFC, 0xDC, 0xF6, 0xD6, 0x15F, 0x15E, 0xE7, 0xC7, 0x11F, 0x11E};
|
||||
char[] latinChars = new char[]{'i', 'I', 'u', 'U', 'o', 'O', 's', 'S', 'c', 'C', 'g', 'G'};
|
||||
char[] turkishChars = new char[] {
|
||||
0x131,
|
||||
0x130,
|
||||
0xFC,
|
||||
0xDC,
|
||||
0xF6,
|
||||
0xD6,
|
||||
0x15F,
|
||||
0x15E,
|
||||
0xE7,
|
||||
0xC7,
|
||||
0x11F,
|
||||
0x11E,
|
||||
};
|
||||
char[] latinChars = new char[] {
|
||||
'i',
|
||||
'I',
|
||||
'u',
|
||||
'U',
|
||||
'o',
|
||||
'O',
|
||||
's',
|
||||
'S',
|
||||
'c',
|
||||
'C',
|
||||
'g',
|
||||
'G',
|
||||
};
|
||||
for (int i = 0; i < turkishChars.length; i++) {
|
||||
param
|
||||
= param.replaceAll(
|
||||
new String(new char[]{turkishChars[i]}), new String(new char[]{latinChars[i]}));
|
||||
param =
|
||||
param.replaceAll(
|
||||
new String(new char[] { turkishChars[i] }),
|
||||
new String(new char[] { latinChars[i] })
|
||||
);
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
Reference in New Issue
Block a user