Arrays.CopyOfRange 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
CopyOfRange(Single[], Int32, Int32) |
将指定数组的指定范围复制到新数组中。 |
CopyOfRange(Int64[], Int32, Int32) |
将指定数组的指定范围复制到新数组中。 |
CopyOfRange(Int32[], Int32, Int32) |
将指定数组的指定范围复制到新数组中。 |
CopyOfRange(Int16[], Int32, Int32) |
将指定数组的指定范围复制到新数组中。 |
CopyOfRange(Object[], Int32, Int32, Class) |
将指定数组的指定范围复制到新数组中。 |
CopyOfRange(Char[], Int32, Int32) |
将指定数组的指定范围复制到新数组中。 |
CopyOfRange(Byte[], Int32, Int32) |
将指定数组的指定范围复制到新数组中。 |
CopyOfRange(Boolean[], Int32, Int32) |
将指定数组的指定范围复制到新数组中。 |
CopyOfRange(Object[], Int32, Int32) |
将指定数组的指定范围复制到新数组中。 |
CopyOfRange(Double[], Int32, Int32) |
将指定数组的指定范围复制到新数组中。 |
CopyOfRange(Single[], Int32, Int32)
将指定数组的指定范围复制到新数组中。
[Android.Runtime.Register("copyOfRange", "([FII)[F", "")]
public static float[] CopyOfRange (float[] original, int from, int to);
[<Android.Runtime.Register("copyOfRange", "([FII)[F", "")>]
static member CopyOfRange : single[] * int * int -> single[]
参数
- original
- Single[]
要从中复制区域的数组
- from
- Int32
要复制的范围的初始索引(含)
- to
- Int32
要复制的范围的最终索引(独占)。 (此索引可能位于数组之外。
返回
一个新数组,其中包含原始数组中的指定范围,截断或填充零,以获取所需的长度
- 属性
例外
if start original.length
if start > end
if original == null
注解
将指定数组的指定范围复制到新数组中。 范围(from
)的初始索引必须介于零和 original.length
(含)之间。 original[from]
值放置在副本的初始元素中(除非from == original.length
或from == to
)。 原始数组中后续元素的值将放入副本中的后续元素中。 范围(to
)的最终索引(必须大于或等于 from
)可能大于 original.length
,在这种情况下 0f
,放置在其索引大于或等于 original.length - from
的副本的所有元素中。 返回的数组的长度将为 to - from
。
已在 1.6 中添加。
适用于 . 的 java.util.Arrays.copyOfRange(float[], int, int)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
CopyOfRange(Int64[], Int32, Int32)
将指定数组的指定范围复制到新数组中。
[Android.Runtime.Register("copyOfRange", "([JII)[J", "")]
public static long[] CopyOfRange (long[] original, int from, int to);
[<Android.Runtime.Register("copyOfRange", "([JII)[J", "")>]
static member CopyOfRange : int64[] * int * int -> int64[]
参数
- original
- Int64[]
要从中复制区域的数组
- from
- Int32
要复制的范围的初始索引(含)
- to
- Int32
要复制的范围的最终索引(独占)。 (此索引可能位于数组之外。
返回
一个新数组,其中包含原始数组中的指定范围,截断或填充零,以获取所需的长度
- 属性
例外
if start original.length
if start > end
if original == null
注解
将指定数组的指定范围复制到新数组中。 范围(from
)的初始索引必须介于零和 original.length
(含)之间。 original[from]
值放置在副本的初始元素中(除非from == original.length
或from == to
)。 原始数组中后续元素的值将放入副本中的后续元素中。 范围(to
)的最终索引(必须大于或等于 from
)可能大于 original.length
,在这种情况下 0L
,放置在其索引大于或等于 original.length - from
的副本的所有元素中。 返回的数组的长度将为 to - from
。
已在 1.6 中添加。
适用于 . 的 java.util.Arrays.copyOfRange(long[], int, int)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
CopyOfRange(Int32[], Int32, Int32)
将指定数组的指定范围复制到新数组中。
[Android.Runtime.Register("copyOfRange", "([III)[I", "")]
public static int[] CopyOfRange (int[] original, int from, int to);
[<Android.Runtime.Register("copyOfRange", "([III)[I", "")>]
static member CopyOfRange : int[] * int * int -> int[]
参数
- original
- Int32[]
要从中复制区域的数组
- from
- Int32
要复制的范围的初始索引(含)
- to
- Int32
要复制的范围的最终索引(独占)。 (此索引可能位于数组之外。
返回
一个新数组,其中包含原始数组中的指定范围,截断或填充零,以获取所需的长度
- 属性
例外
if start original.length
if start > end
if original == null
注解
将指定数组的指定范围复制到新数组中。 范围(from
)的初始索引必须介于零和 original.length
(含)之间。 original[from]
值放置在副本的初始元素中(除非from == original.length
或from == to
)。 原始数组中后续元素的值将放入副本中的后续元素中。 范围(to
)的最终索引(必须大于或等于 from
)可能大于 original.length
,在这种情况下 0
,放置在其索引大于或等于 original.length - from
的副本的所有元素中。 返回的数组的长度将为 to - from
。
已在 1.6 中添加。
适用于 . 的 java.util.Arrays.copyOfRange(int[], int, int)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
CopyOfRange(Int16[], Int32, Int32)
将指定数组的指定范围复制到新数组中。
[Android.Runtime.Register("copyOfRange", "([SII)[S", "")]
public static short[] CopyOfRange (short[] original, int from, int to);
[<Android.Runtime.Register("copyOfRange", "([SII)[S", "")>]
static member CopyOfRange : int16[] * int * int -> int16[]
参数
- original
- Int16[]
要从中复制区域的数组
- from
- Int32
要复制的范围的初始索引(含)
- to
- Int32
要复制的范围的最终索引(独占)。 (此索引可能位于数组之外。
返回
一个新数组,其中包含原始数组中的指定范围,截断或填充零,以获取所需的长度
- 属性
例外
if start original.length
if start > end
if original == null
注解
将指定数组的指定范围复制到新数组中。 范围(from
)的初始索引必须介于零和 original.length
(含)之间。 original[from]
值放置在副本的初始元素中(除非from == original.length
或from == to
)。 原始数组中后续元素的值将放入副本中的后续元素中。 范围(to
)的最终索引(必须大于或等于 from
)可能大于 original.length
,在这种情况下 (short)0
,放置在其索引大于或等于 original.length - from
的副本的所有元素中。 返回的数组的长度将为 to - from
。
已在 1.6 中添加。
适用于 . 的 java.util.Arrays.copyOfRange(short[], int, int)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
CopyOfRange(Object[], Int32, Int32, Class)
将指定数组的指定范围复制到新数组中。
[Android.Runtime.Register("copyOfRange", "([Ljava/lang/Object;IILjava/lang/Class;)[Ljava/lang/Object;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T", "U" })]
public static Java.Lang.Object[] CopyOfRange (Java.Lang.Object[] original, int from, int to, Java.Lang.Class newType);
[<Android.Runtime.Register("copyOfRange", "([Ljava/lang/Object;IILjava/lang/Class;)[Ljava/lang/Object;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T", "U" })>]
static member CopyOfRange : Java.Lang.Object[] * int * int * Java.Lang.Class -> Java.Lang.Object[]
参数
- original
- Object[]
要从中复制区域的数组
- from
- Int32
要复制的范围的初始索引(含)
- to
- Int32
要复制的范围的最终索引(独占)。 (此索引可能位于数组之外。
- newType
- Class
要返回的副本的类
返回
一个新数组,其中包含原始数组中的指定范围,截断或填充为 null 以获取所需的长度
- 属性
注解
将指定数组的指定范围复制到新数组中。 范围(from
)的初始索引必须介于零和 original.length
(含)之间。 original[from]
值放置在副本的初始元素中(除非from == original.length
或from == to
)。 原始数组中后续元素的值将放入副本中的后续元素中。 范围(to
)的最终索引(必须大于或等于 from
)可能大于 original.length
,在这种情况下 null
,放置在其索引大于或等于 original.length - from
的副本的所有元素中。 返回的数组的长度将为 to - from
。 生成的数组是类 newType
。
已在 1.6 中添加。
适用于 . 的 java.util.Arrays.copyOfRange(U[], int, int, java.lang.Class<? extends T[]>)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
CopyOfRange(Char[], Int32, Int32)
将指定数组的指定范围复制到新数组中。
[Android.Runtime.Register("copyOfRange", "([CII)[C", "")]
public static char[] CopyOfRange (char[] original, int from, int to);
[<Android.Runtime.Register("copyOfRange", "([CII)[C", "")>]
static member CopyOfRange : char[] * int * int -> char[]
参数
- original
- Char[]
要从中复制区域的数组
- from
- Int32
要复制的范围的初始索引(含)
- to
- Int32
要复制的范围的最终索引(独占)。 (此索引可能位于数组之外。
返回
一个新数组,其中包含原始数组中的指定范围,截断或填充为 null 字符,以获取所需的长度
- 属性
例外
if start original.length
if start > end
if original == null
注解
将指定数组的指定范围复制到新数组中。 范围(from
)的初始索引必须介于零和 original.length
(含)之间。 original[from]
值放置在副本的初始元素中(除非from == original.length
或from == to
)。 原始数组中后续元素的值将放入副本中的后续元素中。 范围(to
)的最终索引(必须大于或等于 from
)可能大于 original.length
,在这种情况下 '\u005cu0000'
,放置在其索引大于或等于 original.length - from
的副本的所有元素中。 返回的数组的长度将为 to - from
。
已在 1.6 中添加。
适用于 . 的 java.util.Arrays.copyOfRange(char[], int, int)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
CopyOfRange(Byte[], Int32, Int32)
将指定数组的指定范围复制到新数组中。
[Android.Runtime.Register("copyOfRange", "([BII)[B", "")]
public static byte[] CopyOfRange (byte[] original, int from, int to);
[<Android.Runtime.Register("copyOfRange", "([BII)[B", "")>]
static member CopyOfRange : byte[] * int * int -> byte[]
参数
- original
- Byte[]
要从中复制区域的数组
- from
- Int32
要复制的范围的初始索引(含)
- to
- Int32
要复制的范围的最终索引(独占)。 (此索引可能位于数组之外。
返回
一个新数组,其中包含原始数组中的指定范围,截断或填充零,以获取所需的长度
- 属性
例外
if start original.length
if start > end
if original == null
注解
将指定数组的指定范围复制到新数组中。 范围(from
)的初始索引必须介于零和 original.length
(含)之间。 original[from]
值放置在副本的初始元素中(除非from == original.length
或from == to
)。 原始数组中后续元素的值将放入副本中的后续元素中。 范围(to
)的最终索引(必须大于或等于 from
)可能大于 original.length
,在这种情况下 (byte)0
,放置在其索引大于或等于 original.length - from
的副本的所有元素中。 返回的数组的长度将为 to - from
。
已在 1.6 中添加。
适用于 . 的 java.util.Arrays.copyOfRange(byte[], int, int)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
CopyOfRange(Boolean[], Int32, Int32)
将指定数组的指定范围复制到新数组中。
[Android.Runtime.Register("copyOfRange", "([ZII)[Z", "")]
public static bool[] CopyOfRange (bool[] original, int from, int to);
[<Android.Runtime.Register("copyOfRange", "([ZII)[Z", "")>]
static member CopyOfRange : bool[] * int * int -> bool[]
参数
- original
- Boolean[]
要从中复制区域的数组
- from
- Int32
要复制的范围的初始索引(含)
- to
- Int32
要复制的范围的最终索引(独占)。 (此索引可能位于数组之外。
返回
一个新数组,其中包含原始数组中的指定范围、截断或填充为 false 元素以获取所需的长度
- 属性
例外
if start original.length
if start > end
if original == null
注解
将指定数组的指定范围复制到新数组中。 范围(from
)的初始索引必须介于零和 original.length
(含)之间。 original[from]
值放置在副本的初始元素中(除非from == original.length
或from == to
)。 原始数组中后续元素的值将放入副本中的后续元素中。 范围(to
)的最终索引(必须大于或等于 from
)可能大于 original.length
,在这种情况下 false
,放置在其索引大于或等于 original.length - from
的副本的所有元素中。 返回的数组的长度将为 to - from
。
已在 1.6 中添加。
适用于 . 的 java.util.Arrays.copyOfRange(boolean[], int, int)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
CopyOfRange(Object[], Int32, Int32)
将指定数组的指定范围复制到新数组中。
[Android.Runtime.Register("copyOfRange", "([Ljava/lang/Object;II)[Ljava/lang/Object;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Lang.Object[] CopyOfRange (Java.Lang.Object[] original, int from, int to);
[<Android.Runtime.Register("copyOfRange", "([Ljava/lang/Object;II)[Ljava/lang/Object;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member CopyOfRange : Java.Lang.Object[] * int * int -> Java.Lang.Object[]
参数
- original
- Object[]
要从中复制区域的数组
- from
- Int32
要复制的范围的初始索引(含)
- to
- Int32
要复制的范围的最终索引(独占)。 (此索引可能位于数组之外。
返回
一个新数组,其中包含原始数组中的指定范围,截断或填充为 null 以获取所需的长度
- 属性
注解
将指定数组的指定范围复制到新数组中。 范围(from
)的初始索引必须介于零和 original.length
(含)之间。 original[from]
值放置在副本的初始元素中(除非from == original.length
或from == to
)。 原始数组中后续元素的值将放入副本中的后续元素中。 范围(to
)的最终索引(必须大于或等于 from
)可能大于 original.length
,在这种情况下 null
,放置在其索引大于或等于 original.length - from
的副本的所有元素中。 返回的数组的长度将为 to - from
。
生成的数组与原始数组完全相同。
已在 1.6 中添加。
适用于 . 的 java.util.Arrays.copyOfRange(T[], int, int)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。
适用于
CopyOfRange(Double[], Int32, Int32)
将指定数组的指定范围复制到新数组中。
[Android.Runtime.Register("copyOfRange", "([DII)[D", "")]
public static double[] CopyOfRange (double[] original, int from, int to);
[<Android.Runtime.Register("copyOfRange", "([DII)[D", "")>]
static member CopyOfRange : double[] * int * int -> double[]
参数
- original
- Double[]
要从中复制区域的数组
- from
- Int32
要复制的范围的初始索引(含)
- to
- Int32
要复制的范围的最终索引(独占)。 (此索引可能位于数组之外。
返回
一个新数组,其中包含原始数组中的指定范围,截断或填充零,以获取所需的长度
- 属性
例外
if start original.length
if start > end
if original == null
注解
将指定数组的指定范围复制到新数组中。 范围(from
)的初始索引必须介于零和 original.length
(含)之间。 original[from]
值放置在副本的初始元素中(除非from == original.length
或from == to
)。 原始数组中后续元素的值将放入副本中的后续元素中。 范围(to
)的最终索引(必须大于或等于 from
)可能大于 original.length
,在这种情况下 0d
,放置在其索引大于或等于 original.length - from
的副本的所有元素中。 返回的数组的长度将为 to - from
。
已在 1.6 中添加。
适用于 . 的 java.util.Arrays.copyOfRange(double[], int, int)
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。