Java 教程 Java toUpperCase() 方法

phillip · 2022-05-27 00:00:55 · 热度: 79

toUpperCase() 方法将字符串小写字符转换为大写。

语法

public String toUpperCase()

或

public String toUpperCase(Locale locale)

参数

返回值

字符转换为大写后的字符串。

实例

public class Test {
    public static void main(String args[]) {
        String Str = new String("www.codercto.com");

        System.out.print("返回值 :" );
        System.out.println( Str.toUpperCase() );
    }
}

以上程序执行结果为:

返回值 :WWW.CODERCTO.COM

查看更多 Java String 类 相关内容

猜你喜欢:
暂无回复。
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册