Hey guys, I've got stucked on something here ... so to explain it here is an example.
Let's say I have a string "aa a i". My idea is to get a result that is "aA A I". -> this is a challenge on Codehunt and I got stucked on it. I think I figured out how to solve it but I can't get the coding right. So,
what it should be(I believe) first reverse the string so I have "i a aa" , then UpperCase the first char and every char that has a space before it. What I have so far (compiles but won't work correctly), where I am just trying to reverse the string, uppercase the first char, reverse back and return it with the last now letter uppercased
public static String Puzzle(String s) {
String ss = new StringBuilder(s).reverse().toString() ;
char[] c = ss.toCharArray();
c[1] = Character.toUpperCase(c[1]);
ss = new String(c);
s = new StringBuilder(ss).reverse().toString();
return s;
}