toUpperCase(),toLowerCase()将字符串中的英文转换为全大写或全小写

package seday01;
/**
* String toUpperCase()
* String toLowerCase()
* 将字符串中的英文转换为全大写或全小写
* @author xingsir
*/
public class ToUpperCaseDemo {

public static void main(String[] args) {
String str="Hello Java";//字符串
String upper=str.toUpperCase();//全部转换为大写
System.out.println(upper);//打印
String lower=str.toLowerCase();//全部转换为小写
System.out.println(lower);//打印
}

}

猜你喜欢

转载自www.cnblogs.com/xingsir/p/11957733.html
今日推荐