Comment detail

リストを逆順に表示 (Nested Flatten)

「LINQを使えば部分的な反転も出来ます」という例です。

1
2
3
4
5
6
List<object> ary = new List<object>() { 1, 4, 2, 4, 5 };
int index = 2; 
int count = 3;
ary.Reverse(index,count);
ary.ForEach(Console.WriteLine);
// 1, 4, 5, 4, 2

Index

Feed

Other

Link

Pathtraq

loading...