<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] ## 靜態方法 ### String.fromCharCode() unicode轉字符 ``` String.fromCharCode(104, 101, 108, 108, 111) //"hello" ``` ## 實例方法 ### String.prototype.charAt() 字符所在位置 ``` var s = new String('abc'); //= s[1] //"b" s.charAt(1) // "b" s.charAt(s.length - 1) // "c" ``` ### String.prototype.charCodeAt() 返回unicode 碼 ``` 'abc'.charCodeAt(1) // 98 ``` ### String.prototype.concat() 連接字符串 ``` 'a'.concat('b', 'c') // "abc" ``` ### String.prototype.slice()/substring()/substr() 兩個參數,第一個是開始位,第二個是結束位置,不改變原字符串 ``` 'JavaScript'.slice(0, 4) // "Java" ``` ### String.prototype.indexOf()/lastIndexOf() ``` 'hello world'.indexOf('o') // 4 'JavaScript'.indexOf('script') // -1 'hello world'.lastIndexOf('o') // 7 ``` `indexOf`方法還可以接受第二個參數 ``` 'hello world'.indexOf('o', 6) // 7 ``` lastIndexOf的第二個參數表示從該位置起向前匹配 ``` 'hello world'.lastIndexOf('o', 6) // 4 ``` ### String.prototype.trim() 去除空格 trim方法用于去除字符串兩端的空格 ``` ' hello world '.trim() //hello word ``` ``` '\r\nabc \t'.trim() // 'abc' ``` ### String.prototype.toLowerCase()/String.prototype.toUpperCase() ``` 'cat, bat, sat, fat'.match('at') // ["at"] 'cat, bat, sat, fat'.match('xt') // null ``` 可匹配正則 ``` var s ="hello wordd"; s.match(/w.*d/);//[ 'word', index: 6, input: 'hello wordd', groups: undefined ] ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看