从0开始计算,按照显示的结果空格也算一个呀
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>string对象</title>
<script type="text/javascript">
var mystr="Hello World!"
document.write(mystr.substring(6)+ "<br />");
document.write(mystr.substring(0,5) +"<br>");
</script>
</head>
<body>
</body>
</html>
显示结果;
World!
Hello