Skip to content

Commit c9c8824

Browse files
github-actionsgithub-actions
authored andcommitted
Formatted with Google Java Formatter
1 parent d5a46cb commit c9c8824

1 file changed

Lines changed: 28 additions & 26 deletions

File tree

Conversions/TurkishToLatinConversion.java

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,34 @@
99
*/
1010
public class TurkishToLatinConversion {
1111

12-
/**
13-
* Main method
14-
*
15-
* @param args Command line arguments
16-
*/
17-
public static void main(String args[]) {
18-
Scanner sc = new Scanner(System.in);
19-
System.out.println("Input the string: ");
20-
String b = sc.next();
21-
System.out.println("Converted: " + convertTurkishToLatin(b));
22-
sc.close();
23-
}
12+
/**
13+
* Main method
14+
*
15+
* @param args Command line arguments
16+
*/
17+
public static void main(String args[]) {
18+
Scanner sc = new Scanner(System.in);
19+
System.out.println("Input the string: ");
20+
String b = sc.next();
21+
System.out.println("Converted: " + convertTurkishToLatin(b));
22+
sc.close();
23+
}
2424

25-
/**
26-
* This method converts a turkish character to latin character.
27-
*
28-
* @param param String paramter
29-
* @return String
30-
*/
31-
public static String convertTurkishToLatin(String param) {
32-
char[] turkishChars = new char[]{0x131, 0x130, 0xFC, 0xDC, 0xF6, 0xD6, 0x15F, 0x15E, 0xE7, 0xC7, 0x11F, 0x11E};
33-
char[] latinChars = new char[]{'i', 'I', 'u', 'U', 'o', 'O', 's', 'S', 'c', 'C', 'g', 'G'};
34-
for (int i = 0; i < turkishChars.length; i++) {
35-
param = param.replaceAll(new String(new char[]{turkishChars[i]}), new String(new char[]{latinChars[i]}));
36-
}
37-
return param;
25+
/**
26+
* This method converts a turkish character to latin character.
27+
*
28+
* @param param String paramter
29+
* @return String
30+
*/
31+
public static String convertTurkishToLatin(String param) {
32+
char[] turkishChars =
33+
new char[] {0x131, 0x130, 0xFC, 0xDC, 0xF6, 0xD6, 0x15F, 0x15E, 0xE7, 0xC7, 0x11F, 0x11E};
34+
char[] latinChars = new char[] {'i', 'I', 'u', 'U', 'o', 'O', 's', 'S', 'c', 'C', 'g', 'G'};
35+
for (int i = 0; i < turkishChars.length; i++) {
36+
param =
37+
param.replaceAll(
38+
new String(new char[] {turkishChars[i]}), new String(new char[] {latinChars[i]}));
3839
}
40+
return param;
41+
}
3942
}
40-

0 commit comments

Comments
 (0)