|
@@ -31,8 +31,19 @@ public class ROT13 {
|
31
|
31
|
}
|
32
|
32
|
|
33
|
33
|
public static String rotate(String s, Character c) {
|
34
|
|
-
|
35
|
|
- return "";
|
|
34
|
+// int charIndex = 0;
|
|
35
|
+
|
|
36
|
+// char[] charArray = s.toCharArray();
|
|
37
|
+// for(int x = 0; x < charArray.length; x++){
|
|
38
|
+// if (charArray[x] == c){
|
|
39
|
+// charIndex = x;
|
|
40
|
+// }
|
|
41
|
+// }
|
|
42
|
+ int charIndex = s.indexOf(c);
|
|
43
|
+ String rightHalf = s.substring(charIndex);
|
|
44
|
+ String leftHalf = s.substring(0,charIndex);
|
|
45
|
+
|
|
46
|
+ return rightHalf + leftHalf;
|
36
|
47
|
}
|
37
|
48
|
|
38
|
49
|
|