Share via


Edits.Iterator.SourceIndexFromDestinationIndex(Int32) Method

Definition

Computes the source index corresponding to the given destination index.

[Android.Runtime.Register("sourceIndexFromDestinationIndex", "(I)I", "", ApiSince=29)]
public int SourceIndexFromDestinationIndex (int i);
[<Android.Runtime.Register("sourceIndexFromDestinationIndex", "(I)I", "", ApiSince=29)>]
member this.SourceIndexFromDestinationIndex : int -> int

Parameters

i
Int32

destination index

Returns

source index; undefined if i is not 0..string length

Attributes

Remarks

Computes the source index corresponding to the given destination index. If the destination index is inside a change edit (not at its start), then the source index at the end of that edit is returned, since there is no information about index mapping inside a change edit.

(This means that indexes to the start and middle of an edit, for example around a grapheme cluster, are mapped to indexes encompassing the entire edit. The alternative, mapping an interior index to the start, would map such an interval to an empty one.)

This operation will usually but not always modify this object. The iterator state after this search is undefined.

Java documentation for android.icu.text.Edits.Iterator.sourceIndexFromDestinationIndex(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to