点击或拖拽改变大小

SoftBasicAddArrayDataT 方法

一个通用的数组新增个数方法,会自动判断越界情况,越界的情况下,会自动的截断或是填充
A common array of new methods, will automatically determine the cross-border situation, in the case of cross-border, will be automatically truncated or filled

命名空间:  HslCommunication.BasicFramework
程序集:  HslCommunication (在 HslCommunication.dll 中) 版本:11.8.2.0 (11.8.2.0)
语法
public static void AddArrayData<T>(
	ref T[] array,
	T[] data,
	int max
)

参数

array
类型:T
原数据
data
类型:T
等待新增的数据
max
类型:SystemInt32
原数据的最大值

类型参数

T
数据类型
示例
AddArrayData示例
int[] old = new int[5] { 1234, 1235, 1236, 1237, 1238 };
int[] tmp = new int[2] { 456, 457 };


SoftBasic.AddArrayData( ref old, tmp, 6 );
foreach(var m in old)
{
    Console.Write( m + " " );
}

// 输出 1235, 1236, 1237, 1238, 456, 457
参见