日期:2014-05-16 浏览次数:20321 次
<script language="JavaScript" type="text/javascript"> var temp = "abcdefghigk"; alert(temp.slice(0, -3));//abcdefgh alert(temp.substring(0, -3));// alert(temp.slice(6, -3));//gh alert(temp.substring(6, -3));//abcdef alert(temp.slice(2,5));//cde alert(temp.substring(2, 5));//cde </script>