语言

CharBuffer.GetChars(Int32, Int32, Char[], Int32) 方法

定义

将此缓冲区的剩余序列中的字符范围复制到数组中。

[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

参数

srcBegin
Int32

要复制的第一个字符的索引,相对于当前缓冲区位置。 必须为非负值且不大于 srcEnd。

srcEnd
Int32

要复制的最后一个字符之后的索引,相对于当前缓冲区位置。 不能超过 Length()。

dst
Char[]

接收字符的数组。 不得为 null。

dstBegin
Int32

要开始写入的非负目标索引。 数组必须具有减号srcBegin字符的空间srcEnd。

实现

属性

注解

源范围包括 srcBegin 和排除 srcEnd。 源索引相对于当前位置,而不是缓冲区的开头。 此操作不会更改缓冲区的位置。

每个字符的继承的默认实现调用 CharAt(Int32) 。 如果另一个操作缩短了复制过程中的序列,则某些字符复制后可能会发生索引异常。

继承的 CharSequence.getChars 协定的 Android 参考。

适用于