Function

CFStringTransform

Perform in-place transliteration on a mutable string.

Declaration

Boolean CFStringTransform(CFMutableStringRef string, CFRange *range, CFStringRef transform, Boolean reverse);

Parameters

string

The string to transform.

range

A pointer to the range over which the transformation is applied. NULL causes the whole string to be transformed. On return, range is modified to reflect the new range corresponding to the original range.

transform

A CFString object that identifies the transformation to apply. For a list of valid values, see Transform Identifiers for CFStringTransform. In macOS 10.4 and later, you can also use any valid ICU transform ID defined in the ICU User Guide for Transforms.

reverse

A Boolean that, if true, specifies that the inverse transform should be used (if it exists).

Return Value

true if the transform is successful; otherwise false.

Discussion

The transformation represented by transform is applied to the given range of string, modifying it in place. Only the specified range is modified, but the transform may look at portions of the string outside that range for context. Reasons that the transform may be unsuccessful include an invalid transform identifier, and attempting to reverse an irreversible transform.

See Also

CFMutableString Miscellaneous Functions

CFStringAppend

Appends the characters of a string to those of a CFMutableString object.

CFStringAppendCharacters

Appends a buffer of Unicode characters to the character contents of a CFMutableString object.

CFStringAppendCString

Appends a C string to the character contents of a CFMutableString object.

CFStringAppendFormat

Appends a formatted string to the character contents of a CFMutableString object.

CFStringAppendFormatAndArguments

Appends a formatted string to the character contents of a CFMutableString object.

CFStringAppendPascalString

Appends a Pascal string to the character contents of a CFMutableString object.

CFStringCapitalize

Changes the first character in each word of a string to uppercase (if it is a lowercase alphabetical character).

CFStringCreateMutable

Creates an empty CFMutableString object.

CFStringCreateMutableCopy

Creates a mutable copy of a string.

CFStringCreateMutableWithExternalCharactersNoCopy

Creates a CFMutableString object whose Unicode character buffer is controlled externally.

CFStringDelete

Deletes a range of characters in a string.

CFStringFindAndReplace

Replaces all occurrences of a substring within a given range.

CFStringFold

Folds a given string into the form specified by optional flags.

CFStringInsert

Inserts a string at a specified location in the character buffer of a CFMutableString object.

CFStringLowercase

Changes all uppercase alphabetical characters in a CFMutableString to lowercase.

CFStringNormalize

Normalizes the string into the specified form as described in Unicode Technical Report #15.

CFStringPad

Enlarges a string, padding it with specified characters, or truncates the string.

CFStringReplace

Replaces part of the character contents of a CFMutableString object with another string.

CFStringReplaceAll

Replaces all characters of a CFMutableString object with other characters.

CFStringSetExternalCharactersNoCopy

Notifies a CFMutableString object that its external backing store of Unicode characters has changed.

CFStringTrim

Trims a specified substring from the beginning and end of a CFMutableString object.

CFStringTrimWhitespace

Trims whitespace from the beginning and end of a CFMutableString object.

CFStringUppercase

Changes all lowercase alphabetical characters in a CFMutableString object to uppercase.