❔ New to C#
Can somebody tell me what does 'foreach' loop mean?
I search on Chinese Internet,but there isn't any useful informations for new.
Thank you.
6 Replies
A foreach loop executes some code for each element of a list or array.
Works like this
Here we create a list, then loop through every element of it and print it to the console.
thinker227#5176
REPL Result: Success
Console Output
Compile: 522.117ms | Execution: 49.000ms | React with ❌ to remove this embed.
@thinker227 Oh,just like this in Python
thank you
yep
ruguo ni you wenti, keyi wen wo
.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.