Method ToArray
ToArray()
Copies the contents of this span into a new array. The maxLength parameter uses the value of ArrayMaxLengthSafe (将此范围的内容复制到新建数组中. maxLength 参数使用 ArrayMaxLengthSafe 的值).
public T[] ToArray()
Returns
- T[]
An array containing the data in the current span (包含当前跨度中数据的数组).
ToArray(int)
Copies the contents of this span into a new array. It has a maxLength parameters (将此跨度的内容复制到新建数组中. 它具有 maxLength 参数).
public T[] ToArray(int maxLength)
Parameters
maxLength
intThe max length of array (数组的最大长度).
Returns
- T[]
An array containing the data in the current span (包含当前跨度中数据的数组).
Exceptions
- ArgumentOutOfRangeException
The
maxLength
parameter must be greater than 0