问答详情
源自:7-10 提取字符串substring()

显示不出来?

<!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(mychar.indexOf("W"),mystr.length)+ "<br />");

document.write(mystr.substring(0,mychar.indexOf(" "))                   );

</script>

</head>

<body>

</body>

</html>


提问者:殷浩 2017-07-28 18:05

个回答

  • 殷浩
    2017-07-28 18:07:27

    已解决,字符打错了