Browse Source

committing string utilities

Carolynn Vansant 6 years ago
parent
commit
bd516d85fc

+ 5
- 1
src/main/java/com/zipcodewilmington/danny_do_better_exercises/StringUtilities.java View File

94
      * @return an identical string with characters in reverse order.
94
      * @return an identical string with characters in reverse order.
95
      */
95
      */
96
     public static String reverseTheTwo(String stringToReverse){
96
     public static String reverseTheTwo(String stringToReverse){
97
-        return stringToReverse;
97
+        String reverse = "";
98
+        for(int i = stringToReverse.length()-1; i >= 0; i--) {
99
+            reverse += stringToReverse.charAt(i);
100
+        }
101
+        return reverse;
98
     }
102
     }
99
 }
103
 }