方法用的对吗?

来源:3-29 编程练习

Oo君陌oO

2018-12-20 17:23:05

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>toUpperCase和toLowerCase</title>
</head>
<body>
<script>
    var str="Never deter till tomorrow that which you can do today";
var index=str.indexOf("tomorrow");//补充代码
var strNew=str.substr(index,8);//补充代码
var upperStr=strNew.toUpperCase();//补充代码
document.write(upperStr);
</script>
</body>
</html>


写回答

1回答

好帮手慕糖

2018-12-20

同学你好,实现的没有问题,方法也是可以的,不过这个还可以使用其他方法来完成,有兴趣的话,也可以尝试下其他方法,比如:slice()

祝学习愉快!

0

0 学习 · 36712 问题

查看课程