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

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Java - `String regionMatches()`方法 > 原文: [https://beginnersbook.com/2013/12/java-string-regionmatches-method-example/](https://beginnersbook.com/2013/12/java-string-regionmatches-method-example/) 方法`regionMatches()`測試兩個字符串是否相等。使用此方法,我們可以將輸入`String`的子字符串與指定`String`的子字符串進行比較。 兩種變體: `public boolean regionMatches(int toffset, String other, int ooffset, int len)`:區分大小寫的測試。 `public boolean regionMatches(boolean ignoreCase, int toffset, String other, int ooffset, int len)`:可以選擇考慮或忽略大小寫。 **參數說明:** `ignoreCase` - 如果為`true`,則在比較字符時忽略大小寫。 `toffset` - 此字符串中子區域的起始偏移量。 `other` - 字符串參數。 `ooffset` - 字符串參數中子區域的起始偏移量。 `len` - 要比較的字符數。 ### 示例:`regionMatches()`方法 ```java public class RegionMatchesExample{ public static void main(String args[]){ String str1 = new String("Hello, How are you"); String str2 = new String("How"); String str3 = new String("HOW"); System.out.print("Result of Test1: " ); System.out.println(str1.regionMatches(7, str2, 0, 3)); System.out.print("Result of Test2: " ); System.out.println(str1.regionMatches(7, str3, 0, 3)); System.out.print("Result of Test3: " ); System.out.println(str1.regionMatches(true, 7, str3, 0, 3)); } } ``` 輸出: ```java Result of Test1: true Result of Test2: false Result of Test3: true ``` #### 參考: [`regionMatches(int,java.lang.String,int,int)`](https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#regionMatches(int, java.lang.String, int, int))
                  <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>

                              哎呀哎呀视频在线观看