Compartilhar via


String.CodePointCount(Int32, Int32) Method

Definition

Returns the number of Unicode code points in the specified text range of this String.

[Android.Runtime.Register("codePointCount", "(II)I", "")]
public int CodePointCount (int beginIndex, int endIndex);
[<Android.Runtime.Register("codePointCount", "(II)I", "")>]
member this.CodePointCount : int * int -> int

Parameters

beginIndex
Int32

the index to the first char of the text range.

endIndex
Int32

the index after the last char of the text range.

Returns

the number of Unicode code points in the specified text range

Attributes

Exceptions

if start length() || start > end

Remarks

Returns the number of Unicode code points in the specified text range of this String. The text range begins at the specified beginIndex and extends to the char at index endIndex - 1. Thus the length (in chars) of the text range is endIndex-beginIndex. Unpaired surrogates within the text range count as one code point each.

Added in 1.5.

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

See also

  • <xref:Java.Lang.Character.CodePointCount(Java.Lang.ICharSequence%2c+System.Int32%2c+System.Int32)>