StringInfo.GetNextTextElement 方法

定義

取得指定字串中的第一個文字元素。

多載

名稱 Description
GetNextTextElement(String)

取得指定字串中的第一個文字元素。

GetNextTextElement(String, Int32)

取得指定字串索引的文字元素。

GetNextTextElement(String)

來源:
StringInfo.cs
來源:
StringInfo.cs
來源:
StringInfo.cs
來源:
StringInfo.cs
來源:
StringInfo.cs

取得指定字串中的第一個文字元素。

public:
 static System::String ^ GetNextTextElement(System::String ^ str);
public static string GetNextTextElement(string str);
static member GetNextTextElement : string -> string
Public Shared Function GetNextTextElement (str As String) As String

參數

str
String

用來取得文字元素的字串。

傳回

包含指定字串中第一個文字元素的字串。

例外狀況

strnull

備註

.NET 將文字元素定義為以單一字元顯示的文字單位,也就是字素。 文字元素可以是基底字元、替代字元對或組合字元序列。 Unicode 標準將代理對定義為單一抽象字元的編碼字元表示,該字元由兩個編碼單元組成,其中第一個單元為高代理,第二個為低代碼。 Unicode 標準將結合字元序列定義為由一個基礎字元與一個或多個組合字元組成。 替代角色對可以代表基礎角色或組合角色。

此方法僅回傳第一個文字元素。 要遍歷字串的文字元素,應用程式應使用 TextElementEnumerator 方法 GetTextElementEnumerator 產生的物件。

另請參閱

適用於

GetNextTextElement(String, Int32)

來源:
StringInfo.cs
來源:
StringInfo.cs
來源:
StringInfo.cs
來源:
StringInfo.cs
來源:
StringInfo.cs

取得指定字串索引的文字元素。

public:
 static System::String ^ GetNextTextElement(System::String ^ str, int index);
public static string GetNextTextElement(string str, int index);
static member GetNextTextElement : string * int -> string
Public Shared Function GetNextTextElement (str As String, index As Integer) As String

參數

str
String

用來取得文字元素的字串。

index
Int32

文字元素起始的零基索引。

傳回

包含指定字串索引處文字元素的字串。

例外狀況

strnull

index 不在 的 str有效索引範圍內。

備註

.NET 將文字元素定義為以單一字元顯示的文字單位,也就是字素。 文字元素可以是基底字元、替代字元對或組合字元序列。 Unicode 標準將代理對定義為單一抽象字元的編碼字元表示,該字元由兩個編碼單元組成,其中第一個單元為高代理,第二個為低代碼。 Unicode 標準將結合字元序列定義為由一個基礎字元與一個或多個組合字元組成。 替代角色對可以代表基礎角色或組合角色。

此方法僅回傳從指定索引開始的子串第一個文字元素。 要遍歷字串的文字元素,應用程式應使用方法GetTextElementEnumerator產生的。TextElementEnumerator

另請參閱

適用於