Język

CharBuffer.GetChars(Int32, Int32, Char[], Int32) Method

Definition

Copies a range of characters from this buffer's remaining sequence into an array.

[Android.Runtime.Register("getChars", "(II[CI)V", "GetGetChars_IIarrayCIHandler", ApiSince=37)]
public virtual void GetChars(int srcBegin, int srcEnd, char[] dst, int dstBegin);
[<Android.Runtime.Register("getChars", "(II[CI)V", "GetGetChars_IIarrayCIHandler", ApiSince=37)>]
abstract member GetChars : int * int * char[] * int -> unit
override this.GetChars : int * int * char[] * int -> unit

Parameters

srcBegin
Int32

The index of the first character to copy, relative to the current buffer position. Must be non-negative and no greater than srcEnd.

srcEnd
Int32

The index after the last character to copy, relative to the current buffer position. Must not exceed Length().

dst
Char[]

The array that receives the characters. Must not be null.

dstBegin
Int32

The non-negative destination index at which to start writing. The array must have room for srcEnd minus srcBegin characters.

Implements

Attributes

Remarks

The source range includes srcBegin and excludes srcEnd. Source indices are relative to the current position, not the start of the buffer. This operation does not change the buffer's position.

The inherited default implementation calls CharAt(Int32) for each character. If another operation shortens the sequence during the copy, an index exception can occur after some characters have been copied.

Android reference for the inherited CharSequence.getChars contract.

Applies to