I have a function…
var neighbours =
from x in Enumerable.Range(0, array2.GetLength(0))
.Where(x => Math.Abs(x - refx) <= 1)
from y in Enumerable.Range(0, array2.GetLength(1))
.Where(y => Math.Abs(y - refy) <= 1)
select new { x, y };
neighbours.ToList().ForEach(Console.WriteLine);
this func working well.
But I want:
var neighbours =
from x in Enumerable.Range(0, array2.GetLength(0))
.Where(x => Math.Abs(x - refx) <= 1)
from y in Enumerable.Range(0, array2.GetLength(1))
.Where(y => Math.Abs(y - refy) <= 1)
select new { x, y };
neighbours.ToList().ForEach(label3.Text);
It doesn’t working.
So,I want convert System.Action To String…
Any idea for this?
You don’t really want to convert an action to a string. You want to create an action which does something with a value. I suspect you may want something like:
(It’s hard to tell, but that’s my best guess based on your sample code.)
That’s pretty nasty though, in terms of string concatenation. Perhaps you want:
?