为什么加了第二句就出不来结果呢
谢谢帮助我的同学们!
2016-12-28
俩问题,首先少个),还有就是如果你想找空格符,应该是“ ”,而不是“”,用我下面的能行
<!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(mystr.indexOf("W"),mystr.length) + "<br />");
document.write(mystr.substring(1,mystr.indexOf(" ",0)));
</script>
</head>
<body>
</body>
</html>
<!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(mystr.indexOf("W"),mystr.length) + "<br />");
document.write(mystr.substring(1,mystr.indexOf("",0)));
</script>
</head>
<body>
</body>
</html>
举报