CharacterGroupings 类

定义

包含一组字符组和用于获取任何给定字符串的标签的功能。

public ref class CharacterGroupings sealed : IIterable<CharacterGrouping ^>, IVectorView<CharacterGrouping ^>
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [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 CharacterGroupings final : IIterable<CharacterGrouping>, IVectorView<CharacterGrouping>
/// [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)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class CharacterGroupings final : IIterable<CharacterGrouping>, IVectorView<CharacterGrouping>
/// [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)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.Activatable(Windows.Globalization.Collation.ICharacterGroupingsFactory, 262144, "Windows.Foundation.UniversalApiContract")]
class CharacterGroupings final : IIterable<CharacterGrouping>, IVectorView<CharacterGrouping>
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[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 sealed class CharacterGroupings : IEnumerable<CharacterGrouping>, IReadOnlyList<CharacterGrouping>
[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)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class CharacterGroupings : IEnumerable<CharacterGrouping>, IReadOnlyList<CharacterGrouping>
[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)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.Activatable(typeof(Windows.Globalization.Collation.ICharacterGroupingsFactory), 262144, "Windows.Foundation.UniversalApiContract")]
public sealed class CharacterGroupings : IEnumerable<CharacterGrouping>, IReadOnlyList<CharacterGrouping>
function CharacterGroupings()
function CharacterGroupings(language)
Public NotInheritable Class CharacterGroupings
Implements IEnumerable(Of CharacterGrouping), IReadOnlyList(Of CharacterGrouping)
继承
Object Platform::Object IInspectable CharacterGroupings
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

示例

// Create a CharacterGroupings object for the default collation.
var characterGroupings = new Windows.Globalization.Collation.CharacterGroupings();
// Get the number of CharacterGrouping objects.
var size = characterGroupings.size;
if (size > 0) {
    // Get the first characterGrouping.
    var characterGrouping = characterGroupings.getAt(0);
    // Get the first item in this characterGrouping.
    var first = characterGrouping.first;
    // Get the label of the first item in this characterGrouping.
    var label = characterGrouping.label;
}

注解

集合成员列表

对于 JavaScript,CharacterGroupings 的成员显示在成员列表中。 此外,CharacterGroupings 支持 length 属性、 Array.prototype 的成员以及使用索引访问项。

枚举 C# 或 Microsoft Visual Basic 中的集合

CharacterGroupings 是可枚举的,因此可以使用特定于语言的语法(如 C# 中的 foreach )枚举集合中的项。 编译器为你执行类型强制转换,你无需显式强制转换为 IEnumerable<CharacterGrouping> 。 如果需要显式强制转换(例如,如果要调用 GetEnumerator),请使用 CharacterGrouping 约束强制转换为 IEnumerable<T>

版本历史记录

Windows 版本 SDK 版本 已添加值
1703 15063 CharacterGroupings (String)

构造函数

CharacterGroupings()

为默认排序规则创建 CharacterGroupings 对象。

CharacterGroupings(String)

为属于给定语言的排序规则创建 CharacterGroupings 对象。

属性

Size

获取 字符组集中的 CharacterGrouping 对象数。

方法

First()

返回一个迭代器,用于枚举字符组集中的项。

GetAt(UInt32)

返回字符组集中指定索引处的 CharacterGrouping

GetMany(UInt32, CharacterGrouping[])

返回从字符组集中的指定索引处开始的 CharacterGrouping 对象。

IndexOf(CharacterGrouping, UInt32)

返回字符组集中指定 CharacterGrouping 对象的索引。

Lookup(String)

获取所提供的文本所在的标签。

适用于