Instance Method

folding(options:locale:)

Returns a string with the given character folding options applied.

Declaration

func folding(options: NSString.CompareOptions = [], locale: Locale?) -> String

Parameters

options

A mask of compare flags with a suffix InsensitiveSearch.

locale

The locale to use for the folding. To use the current locale, pass [NSLocale current]. To use the system locale, pass nil.

Return Value

A string with the character folding options applied.

Discussion

Character folding operations remove distinctions between characters. For example, case folding may replace uppercase letters with their lowercase equivalents.

The locale affects the folding logic. For example, for the Turkish locale, case-insensitive compare matches “I” to “ı” (U+0131 LATIN SMALL DOTLESS I), not the normal “i” character.