简介JavaScript中toUpperCase()方法的使用

 更新时间:2015年06月06日 12:19:03   投稿:goldensun  
这篇文章主要介绍了JavaScript中的toUpperCase()方法的使用,是JS入门学习中的基础知识,需要的朋友可以参考下

 该方法返回调用字符串值转换为大写。
语法

string.toUpperCase( )


下面是参数的详细信息:

  •     NA

返回值:

  •     返回表示指定对象的字符串

例子:

<html>
<head>
<title>JavaScript String toUpperCase() Method</title>
</head>
<body>
<script type="text/javascript">

var str = "Apples are round, and Apples are Juicy.";

document.write(str.toUpperCase( ));
</script>
</body>
</html>


这将产生以下结果:

APPLES ARE ROUND, AND APPLES ARE JUICY.

相关文章

最新评论