题目:将:“America”、“Greece”、“Britain”、“Canada”、“China”、“Egypt”各个字符串 统一改为大写
toUpperCase() 方法用于把字符串转换为大写。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
var str="America, Greece, Britain,Canada,China,Egypt";
document.write(str+"<br/>");
document.write(str.toUpperCase());
</script>
</body>
</html>
结果: