@SuppressWarnings({"all"})
public class test {
public static void main(String[] args) {
FirstUpperCase("bYte dANCe");
}
public static void FirstUpperCase(String s){
if(s == null || s.isEmpty() || s == " "){
throw new RuntimeException("数据有误");
}
String[] s1 = s.split(" ");
StringBuffer stringBuffer = new StringBuffer();
for (String str:s1) {
stringBuffer.append(Character.toUpperCase
(str.charAt(0))).append(str.substring(1).toLowerCase()).append(" ");
}
System.out.println(stringBuffer.toString());
}
}