<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # String 字符串對象 >[success] **String對象** 用于處理已有的字符串,字符串可以使用單引號或者雙引號。 ## length屬性   length 屬性包含一個整數,用來指出 String 對象中的字符數。String 對象中的最后一個字符的索引為 length - 1。 ~~~ <script> var str = 'hello world'; console.log('str字符串長度為:'+str.length); // str字符串長度為: 11 </script> ~~~ ## indexOf方法 在字符串中查找字符串   返回 String 對象內第一次出現子字符串的字符位置。 ~~~ <script> var str = 'hello world'; console.log(str.indexOf('world')); //執行結果為 6 </script> ~~~ ## match方法 內容匹配   使用正則表達式模式對字符串執行查找,并將包含查找的結果作為數組返回。 ~~~ <script> var str = 'hello world'; console.log(str.match('world')); // ["world", index: 6, input: "hello world"] </script> ~~~ ## replace方法 替換內容   返回根據正則表達式進行文字替換后的字符串的復制。 ~~~ <script> var str = 'hello world'; console.log(str.replace('world','rose')); // hello rose </script> ~~~ ## toUpperCase方法 toLowerCase方法 字符串大小寫轉換 ~~~ <script> var str = 'hello world'; console.log(str.toUpperCase()); // HELLO WORLD console.log(str.toLowerCase()); // hello world </script> ~~~ ## split方法 字符串轉成數組   將一個字符串分割為子字符串,然后將結果作為字符串數組返回。 ~~~ <script> var str = 'hello world'; console.log(str.split(' ')); // ["hello", "world"] </script> ~~~ ## search方法 字符串查找   返回與正則表達式查找內容匹配的第一個子字符串的位置。 ~~~ <script> var s = "The rain in Spain falls mainly in the plain."; re = /falls/i; // 創建正則表達式模式。 r = s.search(re); // 查找字符串。 console.log(r); // 18 </script> ~~~ ## slice方法 字符串截取   返回字符串的片段。 ~~~ <script> var str = 'hello world'; console.log(str.slice(6,8)); // wo </script> ~~~
                  <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>

                              哎呀哎呀视频在线观看