Expected result:
input = "heLlo wOrLd"
output= "Hello World"
Actual result:
output= "Hello world"
My code only capitalizes the first word of the sentence:
public static void main(String args[]) {
String input = "heLlo wOrLd";
String output = input.substring(0, 1).toUpperCase() + input.substring(1).toLowerCase();
System.out.println(output);
}