語言

UCharacter.GetIntPropertyValue(Int32, Int32) 方法

定義

<strong>[icu]</strong> 回傳 Unicode 屬性型別的屬性值。

[Android.Runtime.Register("getIntPropertyValue", "(II)I", "", ApiSince=24)]
public static int GetIntPropertyValue(int ch, int type);
[<Android.Runtime.Register("getIntPropertyValue", "(II)I", "", ApiSince=24)>]
static member GetIntPropertyValue : int * int -> int

參數

ch
Int32

代碼指向測試。

type
Int32

UProperty 選擇器常數,用來識別要檢查哪個二進位屬性。 必須是UProperty.BINARY_START <= 類型

傳回

數值直接等於屬性值,或對於列舉性質,對應於該屬性值類型(ECharacterCategory、ECharacterDirectionDecompositionType等)列舉常數的數值。 對於二進位 Unicode 屬性,回傳 0 或 1(false / true)。 回傳一個位元遮罩以取得遮罩屬性。 若「類型」超出範圍,或 Unicode 版本完全沒有該屬性的資料,或是該碼點的資料不存在,則回傳 0。

屬性

備註

<strong>[icu]</strong> 回傳 Unicode 屬性型別的屬性值。 同時也會回傳二元和遮罩屬性值。

Unicode,特別是在 3.2 版本中,定義的屬性比 UnicodeData.txt的原始集合多得多。

屬性 API 旨在反映 Unicode 字元資料庫(UCD)與 Unicode 技術報告(UTR)中定義的 Unicode 屬性。 有關這些房產的詳細資訊,請參見 http://www.unicode.org/.

關於 Unicode 屬性的名稱,請參見 UCD 檔案 PropertyAliases.txt。

Sample usage:
            int ea = UCharacter.getIntPropertyValue(c, UProperty.EAST_ASIAN_WIDTH);
            int ideo = UCharacter.getIntPropertyValue(c, UProperty.IDEOGRAPHIC);
            boolean b = (ideo == 1) ? true : false;

Java 文件 android.icu.lang.UCharacter.getIntPropertyValue(int, int)。

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

適用於