I was trying to create a string joining elements of an integer array:
string.Join(", ", integerArray.Select(p => p.ToString()).ToArray())
This way I get something like this: 1, 2, 3, 4.
Now I'd like to print, for each element the index of the corresponding position in the array, something like this: {0} 1, {1} 2, {2} 3, {3} 4.
Don't care about format. What I'm wondering is how can I get array index for each selected element in my lambda expression?