点击或拖拽改变大小

SoftBasicArraySplitByLengthT 方法

将指定的数据按照指定长度进行分割,例如int[10],指定长度4,就分割成int[4],int[4],int[2],然后拼接list
Divide the specified data according to the specified length, such as int [10], and specify the length of 4 to divide into int [4], int [4], int [2], and then concatenate the list

命名空间:  HslCommunication.BasicFramework
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
public static List<T[]> ArraySplitByLength<T>(
	T[] array,
	int length
)

参数

array
类型:T
等待分割的数组
length
类型:SystemInt32
指定的长度信息

类型参数

T
数组的类型

返回值

类型:ListT
分割后结果内容
示例
ArraySplitByLength示例
int[] b1 = new int[10] { 12341, -2324, 84646, 324245, 352, 654332, 7687632, 435, 234, 3434 };
List<int[]> b2 = SoftBasic.ArraySplitByLength( b1, 4 );

// b2 共有3个数组
// 数组1   [12341, -2324, 84646, 324245]
// 数组2   [352, 654332, 7687632, 435]
// 数组3   [234, 3434]
参见