Quantcast
Channel: Jack @ ASP.NET » Split
Viewing all articles
Browse latest Browse all 2

C# Code Snippet: List.ForEach method

$
0
0
Do you ever use the List(T).ForEach Method in C#, if never, you’d better read this. The syntax is : public void ForEach(Action<T> action) 1: static void Main() 2: { 3: List<long> myList = new List<long>(); 4: foreach (string item in "269, 361, 347, 355, 352, 346, 351, 354".Split(',')) 5: { 6: myList.Add(long.Parse(item.Trim())); 7: } 8: [...]

Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images