Hello,
The Code is working but after the special character ' the program writes the letter T in Uppercase but i don't know how to write it in lower case.
It's really frustrating.
Thanks for your help in advance!
BR
Java:
public static String camelCase(final String init) {
if (init == null)
return null;
final StringBuilder ret = new StringBuilder(init.length());
//
for (final String word : init.split("[!' ()_+{}\\\\[\\\\]:;,.<>/?-]") ) {
if (!word.isEmpty()) {
ret.append(Character.toUpperCase(word.charAt(0)));
ret.append(word.substring(1).toLowerCase());
}
if (!(ret.length() == init.length()))
ret.append("");
}
return ret.toString();
}
Code:
error code:
expected: <MyNameIsntAlice> but was: <MyNameIsnTAlice>
Expected :MyNameIsntAlice
Actual :MyNameIsnTAlice
The Code is working but after the special character ' the program writes the letter T in Uppercase but i don't know how to write it in lower case.
It's really frustrating.
Thanks for your help in advance!
BR
Zuletzt bearbeitet von einem Moderator: