JavaScript 字符串lastIndexOf函数


JavaScript 字符串lastIndexOf函数

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

   <body>

      <script type = "text/javascript">
         var str1 = new String( "This is string one and again string" );
         var index = str1.lastIndexOf( "string" );
         document.write("lastIndexOf found String :" + index );

         document.write("<br />");

         var index = str1.lastIndexOf( "one" );
         document.write("lastIndexOf found String :" + index );
      </script>

   </body>
</html>