Normalizer.Compare 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| Compare(Char[], Char[], NormalizerCompareOptions) |
比較兩串字串以獲得典範等價。 |
| Compare(Int32, Int32, NormalizerCompareOptions) |
方便的方法,可以更快實現,因為不需要分配緩衝區。 |
| Compare(Int32, String, NormalizerCompareOptions) |
方便的方法,可以更快實現,因為不需要分配緩衝區。 |
| Compare(String, String, NormalizerCompareOptions) |
比較兩串字串以獲得典範等價。 |
| Compare(Char[], Int32, Int32, Char[], Int32, Int32, NormalizerCompareOptions) |
比較兩串字串以獲得典範等價。 |
Compare(Char[], Char[], NormalizerCompareOptions)
比較兩串字串以獲得典範等價。
[Android.Runtime.Register("compare", "([C[CI)I", "", ApiSince=24)]
public static int Compare(char[]? s1, char[]? s2, Android.Icu.Text.NormalizerCompareOptions options);
[<Android.Runtime.Register("compare", "([C[CI)I", "", ApiSince=24)>]
static member Compare : char[] * char[] * Android.Icu.Text.NormalizerCompareOptions -> int
參數
- s1
- Char[]
第一個來源字串。
- s2
- Char[]
第二個來源串。
- options
- NormalizerCompareOptions
預設選項使用位元組:- FOLD_CASE_DEFAULT 或 0 用於預設選項:以碼單元順序進行大小寫區分比較,輸入字串則快速檢查 FCD。
- INPUT_IS_FCD
Set if the caller knows that both s1 and s2 fulfill the FCD
conditions. If not set, the function will quickCheck for FCD
and normalize if necessary.
- COMPARE_CODE_POINT_ORDER
Set to choose code point order instead of code unit order
- COMPARE_IGNORE_CASE
Set to compare strings case-insensitively using case folding,
instead of case-sensitively.
If set, then the following case folding options are used.
傳回
<0、0或 >字串比較時,照例為 0
- 屬性
備註
比較兩串字串以獲得典範等價。 其他選項包括大小寫不區分的比較與碼點排序(相對於碼單位順序)。 方便的方法。
Java 文件 android.icu.text.Normalizer.compare(char[], char[], int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
Compare(Int32, Int32, NormalizerCompareOptions)
方便的方法,可以更快實現,因為不需要分配緩衝區。
[Android.Runtime.Register("compare", "(III)I", "", ApiSince=24)]
public static int Compare(int char32a, int char32b, Android.Icu.Text.NormalizerCompareOptions options);
[<Android.Runtime.Register("compare", "(III)I", "", ApiSince=24)>]
static member Compare : int * int * Android.Icu.Text.NormalizerCompareOptions -> int
參數
- char32a
- Int32
第一個要與
- char32b
- Int32
第二個代碼點
- options
- NormalizerCompareOptions
一組選項
傳回
- 屬性
備註
方便的方法,可以更快實現,因為不需要分配緩衝區。
Java 文件 android.icu.text.Normalizer.compare(int, int, int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
Compare(Int32, String, NormalizerCompareOptions)
方便的方法,可以更快實現,因為不需要分配緩衝區。
[Android.Runtime.Register("compare", "(ILjava/lang/String;I)I", "", ApiSince=24)]
public static int Compare(int char32a, string? str2, Android.Icu.Text.NormalizerCompareOptions options);
[<Android.Runtime.Register("compare", "(ILjava/lang/String;I)I", "", ApiSince=24)>]
static member Compare : int * string * Android.Icu.Text.NormalizerCompareOptions -> int
參數
- char32a
- Int32
第一個要檢查的代碼點
- str2
- String
二線
- options
- NormalizerCompareOptions
一組選項
傳回
- 屬性
備註
方便的方法,可以更快實現,因為不需要分配緩衝區。
Java 文件 android.icu.text.Normalizer.compare(int, java.lang.String, int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
Compare(String, String, NormalizerCompareOptions)
比較兩串字串以獲得典範等價。
[Android.Runtime.Register("compare", "(Ljava/lang/String;Ljava/lang/String;I)I", "", ApiSince=24)]
public static int Compare(string? s1, string? s2, Android.Icu.Text.NormalizerCompareOptions options);
[<Android.Runtime.Register("compare", "(Ljava/lang/String;Ljava/lang/String;I)I", "", ApiSince=24)>]
static member Compare : string * string * Android.Icu.Text.NormalizerCompareOptions -> int
參數
- s1
- String
第一個來源字串。
- s2
- String
第二個來源串。
- options
- NormalizerCompareOptions
預設選項使用位元組:- FOLD_CASE_DEFAULT 或 0 用於預設選項:以碼單元順序進行大小寫區分比較,輸入字串則快速檢查 FCD。
- INPUT_IS_FCD
Set if the caller knows that both s1 and s2 fulfill the FCD
conditions. If not set, the function will quickCheck for FCD
and normalize if necessary.
- COMPARE_CODE_POINT_ORDER
Set to choose code point order instead of code unit order
- COMPARE_IGNORE_CASE
Set to compare strings case-insensitively using case folding,
instead of case-sensitively.
If set, then the following case folding options are used.
傳回
<0、0或 >字串比較時,照例為 0
- 屬性
備註
比較兩串字串以獲得典範等價。 其他選項包括大小寫不區分的比較與碼點排序(相對於碼單位順序)。
兩串字串之間的典範等價定義為其正規化形式(NFD 或 NFC)完全相同。 此函式以增量方式比較字串,而非完全正規化(並可選擇性地摺疊)兩字串,顯著提升效能。
只有當字串不符合 FCD 條件時,才需要大量正規化。 只有在這種情況下,且字串相對較長時,記憶體才會暫時分配。 對於 FCD 字串和短的非 FCD 字串,則沒有記憶體配置。
語意上,這等價於
strcmp[CodePointOrder](foldCase(NFD(s1)), foldCase(NFD(s2)))
其中碼點順序與 foldCase 皆為可選。
Java 文件 android.icu.text.Normalizer.compare(java.lang.String, java.lang.String, int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。
適用於
Compare(Char[], Int32, Int32, Char[], Int32, Int32, NormalizerCompareOptions)
比較兩串字串以獲得典範等價。
[Android.Runtime.Register("compare", "([CII[CIII)I", "", ApiSince=24)]
public static int Compare(char[]? s1, int s1Start, int s1Limit, char[]? s2, int s2Start, int s2Limit, Android.Icu.Text.NormalizerCompareOptions options);
[<Android.Runtime.Register("compare", "([CII[CIII)I", "", ApiSince=24)>]
static member Compare : char[] * int * int * char[] * int * int * Android.Icu.Text.NormalizerCompareOptions -> int
參數
- s1
- Char[]
第一個來源字元陣列。
- s1Start
- Int32
來源索引起始
- s1Limit
- Int32
來源極限
- s2
- Char[]
第二個來源字元陣列。
- s2Start
- Int32
來源的起始索引
- s2Limit
- Int32
來源極限
- options
- NormalizerCompareOptions
預設選項使用位元組:- FOLD_CASE_DEFAULT 或 0 用於預設選項:以碼單元順序進行大小寫區分比較,輸入字串則快速檢查 FCD。
- INPUT_IS_FCD
Set if the caller knows that both s1 and s2 fulfill the FCD
conditions.If not set, the function will quickCheck for FCD
and normalize if necessary.
- COMPARE_CODE_POINT_ORDER
Set to choose code point order instead of code unit order
- COMPARE_IGNORE_CASE
Set to compare strings case-insensitively using case folding,
instead of case-sensitively.
If set, then the following case folding options are used.
傳回
<0、0或 >字串比較時,照例為 0
- 屬性
備註
比較兩串字串以獲得典範等價。 其他選項包括大小寫不區分的比較與碼點排序(相對於碼單位順序)。
兩串字串之間的典範等價定義為其正規化形式(NFD 或 NFC)完全相同。 此函式以增量方式比較字串,而非完全正規化(並可選擇性地摺疊)兩字串,顯著提升效能。
只有當字串不符合 FCD 條件時,才需要大量正規化。 只有在這種情況下,且字串相對較長時,記憶體才會暫時分配。 對於 FCD 字串和短的非 FCD 字串,則沒有記憶體配置。
語意上,這等價於
strcmp[CodePointOrder](foldCase(NFD(s1)), foldCase(NFD(s2)))
其中碼點順序與 foldCase 皆為可選。
Java 文件 android.icu.text.Normalizer.compare(char[], int, int, char[], int, int, int)。
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。