© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
27 replies
__dil__

❔ Iterate over a range

What's the equivalent of this (rust)
for i in 0..10 { /* ...do stuff... */ }
for i in 0..10 { /* ...do stuff... */ }

in C#? So basically, how to loop over a range?

I'm not a big fan of C-style loops 😄 I find them very noisy and cumbersome.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Iterate through Enums
C#CC# / help
15mo ago
✅ Iterate through a genereic type list
C#CC# / help
3y ago
Iterate over AD users and find some properties (EmployeeNumber, ExtensionAttributes, manager,..)
C#CC# / help
4y ago
How to iterate all classes in a name space ?
C#CC# / help
2y ago