c# - concatinating int[] to same size string[] -
i have:
int[] numbers = { 1, 2, 3}; string[] words = { "one", "two", "three" };
and need output
1=one 2=two 3=three
thanks
if same size can use
int[] numbers = { 1, 2, 3}; string[] words = { "one", "two", "three" }; var list = numbers.zip (words, (n, w) => n + "=" + w);
but note if differ in size non match items ignored
Comments
Post a Comment