Can i use foreach instead of for when loops all the array? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can i use foreach instead of for when loops all the array?

I have used foreach for this case on another languages, is the same on c#?

21st Feb 2017, 12:16 AM
degreerichi
degreerichi - avatar
2 Answers
+ 1
It works just the same, yes.
21st Feb 2017, 12:50 AM
Sebastian Grigor
Sebastian Grigor - avatar
+ 1
thanks!
21st Feb 2017, 1:04 AM
degreerichi
degreerichi - avatar