try {
String currentChar = Character.toString(currentString.charAt(i));
- if (c.toUpperCase().equals(currentChar)) {
- System.out.println("up");
- c = c.toUpperCase();
- } else if (c.toLowerCase().equals(currentChar)) {
- System.out.println("low");
- c = c.toLowerCase();
+ if (!currentChar.equals(c)) {
+ if (c.toUpperCase().equals(currentChar)) {
+ c = c.toUpperCase();
+ } else if (c.toLowerCase().equals(currentChar)) {
+ c = c.toLowerCase();
+ }
}
} catch (NullPointerException | StringIndexOutOfBoundsException e) {
}
+
+
//System.out.println(c+";"+currentString.charAt(i));