CFStringGetCharacterAtIndex

Header: CFString.h Carbon status: Supported

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

UniChar CFStringGetCharacterAtIndex (
    CFStringRef theString, 
    CFIndex idx
);
Parameter descriptions
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.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)