public class Demo {
public static void main(String[] args) {
String str = "heLLo";//输出要求:Hello
//String s1 = str.substring(0,1);
//String s2 = str.substring(1);
//String s3 = s1.toUpperCase().concat(s2.toLowerCase());
//System.out.println("s3 = " + s3);
//写成一句话
System.out.println(str.substring(0,1).toUpperCase().concat(
str.substring(1).toLowerCase()));
}
}
请问反转怎么实现? |
|