CFStringGetCharacterAtIndexHeader: CFString.h

Obtains the Unicode character at a specified location in a CFString object.

UniChar CFStringGetCharacterAtIndex (
    CFStringRef theString, 
    CFIndex idx
);
theString

Pass a reference to the CFString object from which the Unicode character is obtained.

idx

Pass an integer indicating the position of the Unicode character in the CFString.

function result

A Unicode character.

DISCUSSION

This function is typically called in a loop to fetch the Unicode characters of a CFString object in sequence or to fetch a character at a known position (first or last, for example). Using it in a loop can be slow, especially with longer strings, so consider the CFStringGetCharacters function or the in-line buffer functions (CFStringInitInlineBuffer and CFStringGetCharacterFromInlineBuffer) as alternatives.


© 1999 Apple Computer, Inc. — (Last Updated 9/15/99)