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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Java - `String toLowerCase()`和`toUpperCase()`方法 > 原文: [https://beginnersbook.com/2013/12/java-string-tolowercase-method-example/](https://beginnersbook.com/2013/12/java-string-tolowercase-method-example/) 方法`toLowerCase()`將`String`的字符轉換為小寫字符。它有兩個變種: `String toLowerCase(Locale locale)`:使用指定的[`Locale`](https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html)定義的規則將字符串轉換為小寫。 `String toLowerCase()`:相當于`toLowerCase(Locale.getDefault())`。`Locale.getDefault()`獲取此 Java 虛擬機實例的默認語言環境的當前值。 Java 虛擬機根據主機環境在啟動期間設置默認語言環境。如果未明確指定語言環境,則許多語言環境敏感方法使用它。可以使用`setDefault()`方法更改它。 ### 示例:`toLowerCase()`方法 ```java import java.util.Locale; public class LowerCaseExample{ public static void main(String args[]){ String str = new String("ABC IS NOT EQUAL TO XYZ"); //Standard method of conversion System.out.println(str.toLowerCase()); //By specifying Locale System.out.println(str.toLowerCase(Locale.FRANCE)); } } ``` 輸出: ```java abc is not equal to xyz abc is not equal to xyz ``` ## 方法:`toUpperCase()` 與`toLowerCase()`方法類似,`toUpperCase()`也有兩個變體: `String toUpperCase(Locale locale)`:它使用指定的`Locale`定義的規則將字符串轉換為大寫字符串。 `String toUpperCase()`:與`toUpperCase(Locale.getDefault())`相當。 ### 示例:`toUpperCase()`方法 ```java import java.util.Locale; public class UpperCaseExample{ public static void main(String args[]){ String str = new String("this is a test string"); //Standard method of conversion System.out.println(str.toUpperCase()); //By specifying Locale System.out.println(str.toUpperCase(Locale.CHINA)); } } ``` 輸出: ```java THIS IS A TEST STRING THIS IS A TEST STRING ```
                  <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>

                              哎呀哎呀视频在线观看