共用方式為


UnicodeCharacters 類別

定義

根據 Unicode 標準附錄 #44,提供應用程式取得 Unicode 字元相關資訊的方法。

public ref class UnicodeCharacters abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class UnicodeCharacters final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public static class UnicodeCharacters
Public Class UnicodeCharacters
繼承
Object Platform::Object IInspectable UnicodeCharacters
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

使用 GetCodepointFromSurrogatePair 準備 Unicode 字元,再將它們傳遞至此類別的任何其他方法,以正確處理增補字元。 如需增補 Unicode 字元的討論,請參閱 Surrogates 和增補字元

處理資料流程中程式碼點的一般程式是:

  1. 使用 IsHighSurrogate 來判斷代碼點是否為高 Surrogate。
  2. 如果不是,請將它傳遞至 UnicodeCharacters 的所需方法。
  3. 否則,程式碼點是高 Surrogate:1。 使用 IsLowSurrogate 檢查資料流程中的下一個字碼點,以判斷它是否為低 Surrogate。
  4. 如果不是,您有不正確程式碼點序列。
  5. 否則,第二個字碼點是低 Surrogate。 將高和低配對傳遞至 GetCodepointFromSurrogatePair ,以取得可傳遞至所需方法的增補 Unicode 字元。

如果輸入不是有效的程式碼點,這個類別中的方法會擲回不正確引數例外狀況。

方法

GetCodepointFromSurrogatePair(UInt32, UInt32)

傳回指定之高與低 Surrogate 字組的增補 Unicode 字元。

GetGeneralCategory(UInt32)

傳回指定 Unicode 字元的 UnicodeGeneralCategory

GetNumericType(UInt32)

傳回指定 Unicode 字元的 UnicodeNumericType

GetSurrogatePairFromCodepoint(UInt32, Char, Char)

傳回指定增補 Unicode 字元的高和低 Surrogate 字組值。

IsAlphabetic(UInt32)

判斷指定的 Unicode 字元是否可視為字母。

IsCased(UInt32)

判斷指定的 Unicode 字元是否可視為大小寫 (大寫、小寫或標題) 。

IsGraphemeBase(UInt32)

判斷指定的 Unicode 字元是否可視為 grapheme 的開頭。

IsGraphemeExtend(UInt32)

判斷指定的 Unicode 字元是否可考慮繼續先前的 Grapheme。

IsHighSurrogate(UInt32)

判斷指定的 Unicode 字元是否為高 Surrogate。

IsIdContinue(UInt32)

判斷指定的 Unicode 字元是否可以在程式設計中視為識別碼的接續字元。

IsIdStart(UInt32)

判斷指定的 Unicode 字元是否可以在程式設計中視為識別碼的起始字元。

IsLowercase(UInt32)

判斷指定的 Unicode 字元是否可視為小寫字元。

IsLowSurrogate(UInt32)

判斷指定的 Unicode 字元是否為低 Surrogate。

IsNoncharacter(UInt32)

判斷指定的代碼點是否為非字元。

IsSupplementary(UInt32)

判斷指定的 Unicode 字元是否為增補字元。

IsUppercase(UInt32)

判斷指定的 Unicode 字元是否可視為大寫字元。

IsWhitespace(UInt32)

判斷指定的 Unicode 字元是否可視為空白字元。

適用於

另請參閱