久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      JavaScript用什么分割成數(shù)組

      JavaScript用split()方法分割成數(shù)組,語法格式為“字符串對象.split(字符串或正則表達(dá)式,返回數(shù)組的最大長度)”。split()方法用于把一個字符串分割成字符串?dāng)?shù)組。

      JavaScript用什么分割成數(shù)組

      本教程操作環(huán)境:windows7系統(tǒng)、javascript1.8.5版、Dell G3電腦。

      split() 方法用于把一個字符串分割成字符串?dāng)?shù)組。

      語法:

      stringObject.split(separator,howmany)

      JavaScript用什么分割成數(shù)組

      返回值

      一個字符串?dāng)?shù)組。該數(shù)組是通過在 separator 指定的邊界處將字符串 stringObject 分割成子串創(chuàng)建的。返回的數(shù)組中的字串不包括 separator 自身。

      但是,如果 separator 是包含子表達(dá)式的正則表達(dá)式,那么返回的數(shù)組中包括與這些子表達(dá)式匹配的字串(但不包括與整個正則表達(dá)式匹配的文本)。

      提示和注釋

      注釋:如果把空字符串 ("") 用作 separator,那么 stringObject 中的每個字符之間都會被分割。

      注釋:String.split() 執(zhí)行的操作與 Array.join 執(zhí)行的操作是相反的。

      實(shí)例

      <script type="text/javascript">  var str="How are you doing today?"  document.write(str.split(" ") + "<br />") document.write(str.split("") + "<br />") document.write(str.split(" ",3))  </script>

      輸出:

      How,are,you,doing,today? H,o,w, ,a,r,e, ,y,o,u, ,d,o,i,n,g, ,t,o,d,a,y,? How,are,you

      【推薦學(xué)習(xí):javascript高級教程】

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號