<script language="JavaScript"> var str = "www.520mg.com"; document.write( str.substr(4,5) ); </script>
运行该例子,输出:520mg
520mg
0