3

我有两个字符串数组

Array1 = {"Paul","John","Mary"}
Array2 = {"12","13","15"}

我想知道是否可以加入这些数组,以便生成的数组具有类似

{"Paul12","John13","Mary15"}
4

2 回答 2

8
 var Array3 = Array1.Zip(Array2, (a, b) => a + b).ToList();
于 2012-04-11T07:03:59.197 回答
6

您可以使用Zip.

var array1 = new[] {"Paul", "John", "Mary"};
var array2 = new[] {"12", "13", "15"};

var result = array1.Zip(array2, (a1, a2) => String.Concat(a1, a2)).ToArray();
于 2012-04-11T07:05:08.507 回答