JavaScript 字符串 string slice方法


JavaScript 字符串 string slice方法

<html>
   <head>
      <title>JavaScript String slice() Method</title>
   </head>

   <body>

      <script type = "text/javascript">
         var str = "Apples are round, and apples are juicy.";
         var sliced = str.slice(3, -2);

         document.write( sliced );
      </script>

   </body>
</html>