In VB.NET, I can do this:
MyArray.Select(Function(a)
Dim x as string
x = a
Return x
End Function)
How can I do this in c#?
In VB.NET, I can do this:
MyArray.Select(Function(a)
Dim x as string
x = a
Return x
End Function)
How can I do this in c#?
It looks like the VB.Net is just selecting each element in MyArray, in c#
MyArray.Select(a => (string) a);
To make it a method, use braces:
MyArray.Select(a =>
{
...
return ...;
});