JS中substring()的用法

例一:

<script type="text/javascript">

 var str="Hello world!" document.write(str.substring(3))

</script>

输出:

lo world!

例二:

<script type="text/javascript">

 var str="Hello world!" document.write(str.substring(3,7))

 </script>

输出:

lo w
原文地址:https://www.cnblogs.com/weimingxin/p/6917303.html