I can do loop with more then one condition like this:
for (int i = 0; condition1 && condition2 && ... && conditionN ; i++) {
}
Is there any way to do it using foreach:
foreach (var i in arr and while condition1 && condition2 && ... && conditionN) {
}
But without using break;?
I need this in order to pass on Enumerable and I don’t want continue iterations if my condition is not true.
You can use the Enumerable.TakeWhile Extension Method:
This is roughly equivalent to: