老师看下代码是否正确
来源:3-14 编程练习
yarwood
2020-08-27 23:10:51
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>string方法</title>
</head>
<body>
<script>
var str="Program ape world you do not understand";
document.write(str.slice(12,17));
document.write("<br/>");
document.write(str.substring(12,17));
document.write("<br/>");
document.write(str.substr(12,5));//5是长度不是索引
</script>
</body>
</html>
1回答
同学你好,代码实现正确哦。继续加油,祝学习愉快~
相似问题