Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

CharacterGroupings class

Applies to Windows and Windows Phone

Contains the set of character groups and the functionality to get the label for any given string.

Syntax


var characterGroupings = new Windows.Globalization.Collation.CharacterGroupings();

Attributes

[DualApiPartition()]
[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]

Members

The CharacterGroupings class has these types of members:

Constructors

The CharacterGroupings class has these constructors.

ConstructorDescription
CharacterGroupings Create a CharacterGroupings object for the default collation.

 

Methods

The CharacterGroupings class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
First [C++, JavaScript]Returns an iterator to enumerate the items in the set of character groups.
GetAt [C++, JavaScript]Returns the CharacterGrouping at the specified index in the set of character groups.
GetMany [C++, JavaScript]Returns the CharacterGrouping objects that start at the specified index in the set of character groups.
IndexOf [C++, JavaScript]Returns the index of a specified CharacterGrouping object in the set of character groups.
Lookup [C++, JavaScript]Gets the label under which the provided text falls.

 

Properties

The CharacterGroupings class has these properties.

PropertyAccess typeDescription

Count [C#, VB]

Read-onlyGets the number of elements contained in the collection.

Item [C#, VB]

Read-onlyGets or sets the element at the specified index.

Size [C++, JavaScript]

Read-onlyGets the number of CharacterGrouping objects in the set of character groups.

 

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.

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;
}

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Globalization.Collation
Windows::Globalization::Collation [C++]

Metadata

Windows.winmd

 

 

Show:
© 2014 Microsoft