CFStringGetCharacterAtIndex(_:_:)
Returns the Unicode character at a specified location in a string.
Declaration
func CFStringGetCharacterAtIndex(_ theString: CFString!, _ idx: CFIndex) -> UniCharParameters
- theString:
The string from which the Unicode character is obtained.
- idx:
The position of the Unicode character in the CFString.
Return Value
A Unicode character.
Discussion
This function is typically called in a loop to fetch the Unicode characters of a string in sequence or to fetch a character at a known position (first or last, for example). Using it in a loop can be inefficient, especially with longer strings, so consider the CFStringGetCharacters(_:_:_:) function or the in-line buffer functions (CFStringInitInlineBuffer(_:_:_:) and CFStringGetCharacterFromInlineBuffer(_:_:)) as alternatives.
See Also
Accessing Characters
CFStringCreateExternalRepresentation(_:_:_:_:)CFStringGetBytes(_:_:_:_:_:_:_:_:)CFStringGetCharacters(_:_:_:)CFStringGetCharactersPtr(_:)CFStringGetCharacterFromInlineBuffer(_:_:)CFStringGetCString(_:_:_:_:)CFStringGetCStringPtr(_:_:)CFStringGetLength(_:)CFStringGetPascalString(_:_:_:_:)CFStringGetPascalStringPtr(_:_:)CFStringGetRangeOfComposedCharactersAtIndex(_:_:)CFStringInitInlineBuffer(_:_:_:)