如何将两个一维字符串数组A和B合并到一个新一维数组C中 如何将两个一维字符串数组A和B合并到一个新一维数组C中 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 int[] temp1 = new int[12]; int[] temp2 = new int[13]; int[] temp3 = new int[temp1.Length + temp2.Length]; Array.Copy(temp1, temp3, temp1.Length); Array.Copy(temp2, temp3, temp1.Length, temp2.Length); string[] arr = new string[4]; string[] tmp = new string[6]; string[] c = new string[arr.Length + tmp.Length]; for (int i = 0; i < arr.Length; i++) { arr[i] = i.ToString() + "ab"; } for (int j = 0; j < tmp.Length; j++) { tmp[j] = j.ToString() + "cc"; } arr.CopyTo(c,0); tmp.CopyTo(c, arr.Length); 呵呵,又先一步。就数据的CopyTo()就能合并了。 int[] i;int[] j;List<int> r = new List<int>();r.AddRange(i);r.AddRange(j);int[] c = r.ToArray(); Tx Text Control 输入时在文本不显示预览怎么做?? 获取区间内的随机整数,出现重复的疑惑 可否用linq进行排序? 用c#怎么登陆域中的其他机器 求正则表达式过滤HTML样式 事件A动态生成了checkboxlist控件,事件B对生成的checkboxlist进行了勾选和取消操作,并想提交勾选的结果。 定向问题 菜鸟提问,如何实现数据库的相对路径设置??? C#多线程抓取网页并限制线程个数问题 关于编译C#程序的问题? 用socket收到一串用zlib压缩的字串,在c#中如何解压 未能找到文件的错误
int[] temp2 = new int[13];
int[] temp3 = new int[temp1.Length + temp2.Length];
Array.Copy(temp1, temp3, temp1.Length);
Array.Copy(temp2, temp3, temp1.Length, temp2.Length);
string[] arr = new string[4];
string[] tmp = new string[6];
string[] c = new string[arr.Length + tmp.Length];
for (int i = 0; i < arr.Length; i++)
{
arr[i] = i.ToString() + "ab";
} for (int j = 0; j < tmp.Length; j++)
{
tmp[j] = j.ToString() + "cc";
}
arr.CopyTo(c,0);
tmp.CopyTo(c, arr.Length);
就数据的CopyTo()就能合并了。
int[] j;
List<int> r = new List<int>();
r.AddRange(i);
r.AddRange(j);
int[] c = r.ToArray();