For example, I input "i Am Going \s\s\s to go tO the mall" the wide spaces(\s) must turn into single space.
String f = line.substring(0,1).toUpperCase() + line.substring(1).toLowerCase();
String[] split = f.split(" ");
for(int i=0;i<split.length;i++){
System.out.print (split[i] + " ");
}