Added in API level 29

Fold


class Fold : CaseMap
kotlin.Any
   ↳ android.icu.text.CaseMap
   ↳ android.icu.text.CaseMap.Fold

Case folding options and methods. Immutable.

Summary

Public methods
String!

Case-folds a string.

A
apply(src: CharSequence!, dest: A, edits: Edits!)

Case-folds a string and optionally records edits (see omitUnchangedText).

CaseMap.Fold!

Returns an instance that behaves like this one but omits unchanged text when case-mapping with Edits.

CaseMap.Fold!

Returns an instance that behaves like this one but handles dotted I and dotless i appropriately for Turkic languages (tr, az).

Inherited functions

Public methods

apply

Added in API level 29
fun apply(src: CharSequence!): String!

Case-folds a string. The result may be longer or shorter than the original.

Case-folding is locale-independent and not context-sensitive, but there is an option for whether to include or exclude mappings for dotted I and dotless i that are marked with 'T' in CaseFolding.txt.

Parameters
src CharSequence!: The original string.
Return
String! the result string.

apply

Added in API level 29
fun <A : Appendable!> apply(
    src: CharSequence!,
    dest: A,
    edits: Edits!
): A

Case-folds a string and optionally records edits (see omitUnchangedText). The result may be longer or shorter than the original.

Case-folding is locale-independent and not context-sensitive, but there is an option for whether to include or exclude mappings for dotted I and dotless i that are marked with 'T' in CaseFolding.txt.

Parameters
src CharSequence!: The original string.
dest A: A buffer for the result string. Must not be null.
edits Edits!: Records edits for index mapping, working with styled text, and getting only changes (if any). This function calls edits.reset() first. edits can be null.
Return
A dest with the result string (or only changes) appended.

omitUnchangedText

Added in API level 29
fun omitUnchangedText(): CaseMap.Fold!

Returns an instance that behaves like this one but omits unchanged text when case-mapping with Edits.

Return
CaseMap.Fold! an options object with this option.

turkic

Added in API level 29
fun turkic(): CaseMap.Fold!

Returns an instance that behaves like this one but handles dotted I and dotless i appropriately for Turkic languages (tr, az).

Uses the Unicode CaseFolding.txt mappings marked with 'T' that are to be excluded for default mappings and included for the Turkic-specific mappings.

Return
CaseMap.Fold! an options object with this option.