Home  >  Article  >  Web Front-end  >  JavaScript字符串对象toUpperCase方法入门实例(用于把字母转换为大写)_基础知识

JavaScript字符串对象toUpperCase方法入门实例(用于把字母转换为大写)_基础知识

WBOY
WBOYOriginal
2016-05-16 16:33:341416browse

JavaScript toUpperCase方法

toUpperCase方法用于把(英文)字符串转换为大写,并返回转换后的字符串。其语法如下:

复制代码 代码如下:

str_object.toUpperCase()

toUpperCase方法实例

复制代码 代码如下:


运行该例子,输出:

复制代码 代码如下:

AABBCC

toLocaleUpperCase方法

toLocaleUpperCase方法 toUpperCase基本一样,toLocaleUpperCase按照本地方式把字符串转换为大写。只有几种语言(如土耳其语)具有地方特有的大小写映射。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn