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

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Java - `String getChars()`方法 > 原文: [https://beginnersbook.com/2013/12/java-string-getchars-method-example/](https://beginnersbook.com/2013/12/java-string-getchars-method-example/) 方法`getChars()`用于將`String`字符復制到字符數組。 ```java public void getChars(int srcBegin, int srcEnd, char[] dest, int destBegin) ``` **參數說明:** `srcBegin` - 要復制的字符串中第一個字符的索引。 `srcEnd` - 要復制的字符串中最后一個字符后的索引。 `dest` - 目標字符數組,其中`String`中的字符被復制。 `destBegin` - 數組中的索引,從字符將被推入數組開始。 拋出`IndexOutOfBoundsException` - 如果出現以下任何一種情況: (`srcBegin < 0`)`srcBegin`小于零。 (`srcBegin > srcEnd`)`srcBegin`大于`srcEnd`。 (`srcEnd > string.length`)`srcEnd`大于此字符串的長度。 (`destBegin < 0`)`destBegin`為負。 `dstBegin+(srcEnd-srcBegin)`大于`dest.length`。 ### 示例:`getChars()`方法 ```java public class GetCharsExample{ public static void main(String args[]){ String str = new String("This is a String Handling Tutorial"); char[] array = new char[6]; str.getChars(10, 16, array, 0); System.out.println("Array Content:" ); for(char temp: array){ System.out.print(temp); } char[] array2 = new char[]{'a','a','a','a','a','a','a','a'}; str.getChars(10, 16, array2, 2); System.out.println("Second Array Content:" ); for(char temp: array2){ System.out.print(temp); } } } ``` 輸出: ```java Array Content: StringSecond Array Content: aaString ```
                  <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>

                              哎呀哎呀视频在线观看