Finding Characters with Specific Properties

Use the class ICharacterPropertyIterator to find the set of Unicode characters with particular properties. This iterator identifies the set of characters with a specified range of properties, based on the IUnicode::ECharacterProperty enum.

  1. Create an ICharacterPropertyIterator, specifying the range of properties to identify.
  2. Use operator++ to advance the iterator.
  3. Use operator* to access the character currently referenced by the iterator.
  4. Use operator bool to determine when the iterator is at the end of the list.

For example, this code shows how to iterate through the Unicode character set and build a list of cased letters (characters with either a lowercase or an uppercase property):

UniChar longList[65536];

int n = 0;

// Create the iterator

ICharacterPropertyIterator iter(IUnicode::kUpperCaseLetter, 

	IUnicode::kLowerCaseLetter);

while(iter) {

	// Access the next character with case properties

	longList[n] = iter*;

	// Advance the iterator

	iter++;

	n++;

}


Character Properties