Share via


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

Definition

Copies characters from this string into the destination character array.

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

Parameters

srcBegin
Int32

index of the first character in the string to copy.

srcEnd
Int32

index after the last character in the string to copy.

dst
Char[]

the destination array.

dstBegin
Int32

the start offset in the destination array.

Attributes

Exceptions

if buffer is null.

if start , end > length(), start > end, index , end - start > buffer.length - index

Remarks

Copies characters from this string into the destination character array.

The first character to be copied is at index srcBegin; the last character to be copied is at index srcEnd-1 (thus the total number of characters to be copied is srcEnd-srcBegin). The characters are copied into the subarray of dst starting at index dstBegin and ending at index: <blockquote>

dstBegin + (srcEnd-srcBegin) - 1

</blockquote>

Java documentation for java.lang.String.getChars(int, int, char[], 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