StringInfo.GetNextTextElement 方法

定义

获取指定字符串中的第一个文本元素。

重载

名称 说明
GetNextTextElement(String)

获取指定字符串中的第一个文本元素。

GetNextTextElement(String, Int32)

获取指定字符串的指定索引处的文本元素。

GetNextTextElement(String)

Source:
StringInfo.cs
Source:
StringInfo.cs
Source:
StringInfo.cs
Source:
StringInfo.cs
Source:
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)

Source:
StringInfo.cs
Source:
StringInfo.cs
Source:
StringInfo.cs
Source:
StringInfo.cs
Source:
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 标准将组合字符序列定义为基字符和一个或多个组合字符的组合。 代理项对可以表示基字符或组合字符。

此方法仅返回从指定索引处开始的子字符串的第一个文本元素。 若要循环访问字符串的文本元素,应用程序应使用 TextElementEnumerator 该方法生成的 GetTextElementEnumerator 元素。

另请参阅

适用于