tagged [foreach]

Changing Foreach Order?

Changing Foreach Order? Is there anyway to foreach through a list from the end to the beginning rather than the beginning to then end (preferably without reordering the list).

23 Jul at 17:44

"Nested foreach" vs "lambda/linq query" performance(LINQ-to-Objects)

"Nested foreach" vs "lambda/linq query" performance(LINQ-to-Objects) In performance point of view what should you use "Nested foreach's" or "lambda/linq queries"?

25 Jun at 14:22

Possible to iterate backwards through a foreach?

Possible to iterate backwards through a foreach? I know I could use a `for` statement and achieve the same effect, but can I loop backwards through a `foreach` loop in C#?

14 Apr at 13:2

How do I copy items from list to list without foreach?

How do I copy items from list to list without foreach? How do I transfer the items contained in one `List` to another in C# without using `foreach`?

25 Oct at 19:11

Parallel.ForEach Debug or Step Through

Parallel.ForEach Debug or Step Through Is there an easy way to step through a parallel.foreach? What is the best way to debug this with a break point?

19 Jun at 20:37

Can you enumerate a collection in C# out of order?

Can you enumerate a collection in C# out of order? Is there a way to use a `foreach` loop to iterate through a collection backwards or in a completely random order?

31 Oct at 19:25

How can I know a row index while iterating with foreach?

How can I know a row index while iterating with foreach? in the next example how can I know the current row index?

8 Oct at 22:14

Bash foreach loop

Bash foreach loop I have an input (let's say a file). On each line there is a file name. How can I read this file and display the content for each one.

12 Nov at 08:43

Can LINQ ForEach have if statement?

Can LINQ ForEach have if statement? Is it possible to add `if`-statement inside LINQ `ForEach` call?

4 Jul at 03:34

Does Parallel.ForEach limit the number of active threads?

Does Parallel.ForEach limit the number of active threads? Given this code: Will all 1000 threads spawn almost simultaneously?