Tag: extension-methods

56 votes
6 answers
2.1K views
Convert string[] to int[] in one line of code using LINQ

I have an array of integers in string form: var arr = new string[] { "1", "2", "3", "4" }; I need to an arr

avatar
Karolyn
0 1 0 9
asked 07 September, 2021
49 votes
10 answers
1.2K views
Which method performs better: .Any() vs .Count() > 0?

in the System.Linq namespace, we can now extend our IEnumerable's to have the Any() and Count() extension

avatar
Luis
0 1 0 9
asked 07 September, 2021
62 votes
21 answers
2.6K views
Why is there no ForEach extension method on IEnumerable?

Inspired by another question asking about the missing Zip function: Why is there no ForEach extension method o

avatar
Ali
0 1 0 9
asked 07 September, 2021