CharacterGroupings Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Contains the set of character groups and the functionality to get the label for any given string.
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)
- Inheritance
- Attributes
- Implements
Windows requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Examples
// 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;
}
Remarks
Collection member lists
For JavaScript, CharacterGroupings has the members shown in the member lists. In addition, CharacterGroupings supports a length property, members of Array.prototype, and using an index to access items.
Enumerating the collection in C# or Microsoft Visual Basic
CharacterGroupings is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable<CharacterGrouping>
explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable<T> with a CharacterGrouping constraint.
Version history
Windows version | SDK version | Value added |
---|---|---|
1703 | 15063 | CharacterGroupings(String) |
Constructors
CharacterGroupings() |
Create a CharacterGroupings object for the default collation. |
CharacterGroupings(String) |
Create a CharacterGroupings object for the collation belonging to the given language. |
Properties
Size |
Gets the number of CharacterGrouping objects in the set of character groups. |
Methods
First() |
Returns an iterator to enumerate the items in the set of character groups. |
GetAt(UInt32) |
Returns the CharacterGrouping at the specified index in the set of character groups. |
GetMany(UInt32, CharacterGrouping[]) |
Returns the CharacterGrouping objects that start at the specified index in the set of character groups. |
IndexOf(CharacterGrouping, UInt32) |
Returns the index of a specified CharacterGrouping object in the set of character groups. |
Lookup(String) |
Gets the label under which the provided text falls. |