Freigeben über


String.OffsetByCodePoints(Int32, Int32) Method

Definition

Returns the index within this String that is offset from the given index by codePointOffset code points.

[Android.Runtime.Register("offsetByCodePoints", "(II)I", "")]
public int OffsetByCodePoints (int index, int codePointOffset);
[<Android.Runtime.Register("offsetByCodePoints", "(II)I", "")>]
member this.OffsetByCodePoints : int * int -> int

Parameters

index
Int32

the index to be offset

codePointOffset
Int32

the offset in code points

Returns

the index within this String

Attributes

Exceptions

if index is negative or greater than length() or if there aren't enough code points before or after index to match codePointOffset.

Remarks

Returns the index within this String that is offset from the given index by codePointOffset code points. Unpaired surrogates within the text range given by index and codePointOffset count as one code point each.

Added in 1.5.

Java documentation for java.lang.String.offsetByCodePoints(int, 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