語言

String.ToUpperCase 方法

定義

多載

名稱 Description
ToUpperCase(Locale)

利用給定String的規則將此Locale中所有字元轉換為大寫字母。

ToUpperCase()

會依照預設地區的規則,將所有 String 字元轉換成大寫。

ToUpperCase(Locale)

利用給定String的規則將此Locale中所有字元轉換為大寫字母。

[Android.Runtime.Register("toUpperCase", "(Ljava/util/Locale;)Ljava/lang/String;", "")]
public string ToUpperCase(Java.Util.Locale locale);
[<Android.Runtime.Register("toUpperCase", "(Ljava/util/Locale;)Ljava/lang/String;", "")>]
member this.ToUpperCase : Java.Util.Locale -> string

參數

locale
Locale

在此地點使用格轉換規則

傳回

String,轉換為大寫字母。

屬性

備註

利用給定String的規則將此Locale中所有字元轉換為大寫字母。 格映射基於該類別所規定 java.lang.Character Character 的 Unicode 標準版本。 由於案例映射不一定是 1:1 字元映射,結果 String 可能與原始 String不同長度。

地點敏感及1:M案例映射的範例見下表。

<table class=“plain”caption>< style=“display:none”>:locale-sensitive 及 1:M 案例映射的範例。 顯示語言代碼:地區、小寫、大寫及描述。</caption thead><tr><th scope=“col”>語言代碼 地區/<th><scope =“col”>小寫</th><scope =“col”大寫/th><scope =“col”>大寫</th scope =“col”>描述</th></tr></thead><tbody><tr><td>tr (土耳其語)</td><th scope =“row” style=“font-weight:normal; text-align:left”>\<>u0069</th><TD>\u0130</td><TD 小>寫字母 I -> 大寫字母 I 上方加點</td></tr><tr td><>tr(土耳其語)</td><th scope=“row” style=“font-weight:normal; text-align:left”>\u0131</th><TD>\U0049</TD><TD>小寫無點 I -> 大寫字母 I</td></tr><tr><td>(all)</td><th scope =“row” style=“font-weight:normal; text-align:left”>\u00df</th><TD>\u0053 \u0053</td><TD>小寫升號 S -> 兩個字母:SS</td></tr><tr><td>(all)</td><th scope =“row” style=“font-weight:normal; text-align:left”>Fahrvergnü通用</th><TD>FAHRVERGNÜGEN</td><td></td></tr></tbody></table>

在 1.1 版本中加入。

Java 文件 java.lang.String.toUpperCase(java.util.Locale)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

ToUpperCase()

會依照預設地區的規則,將所有 String 字元轉換成大寫。

[Android.Runtime.Register("toUpperCase", "()Ljava/lang/String;", "")]
public string ToUpperCase();
[<Android.Runtime.Register("toUpperCase", "()Ljava/lang/String;", "")>]
member this.ToUpperCase : unit -> string

傳回

String,轉換為大寫字母。

屬性

備註

會依照預設地區的規則,將所有 String 字元轉換成大寫。 此方法等價於 toUpperCase(Locale.getDefault())

<b>注意:</b> 此方法對區域敏感,若用於意圖獨立解讀區域的字串,可能會產生意想不到的結果。 例如程式語言識別碼、協定金鑰和 HTML 標籤。 例如, "title".toUpperCase() 在土耳其地區回傳 "T\u005Cu0130TLE",其中「\u005Cu0130」是拉丁大寫字母 I,上方加點。 要獲得局部不敏感字串的正確結果,請使用 toUpperCase(Locale.ROOT)

Java 文件 java.lang.String.toUpperCase()

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於