[resolved] Cs equivalent of (0..10).map [Answered]
In rust I'd write smoething like (0..10).map( to iterate over a range of numbers. Obviously I can do it with a for loop but I'd prefer an IEnumerable that I can select on.
12 Replies
I really just want to call a function 10 times and make an IEnumerable out of the results
Enumerable.Range(0, 10).Select(...)
That'll do it
Thanks
There's a
/close
command✅ This post has been marked as answered!
Got it, next time
You do Rust programming Nathaniel?
@mtreit Yes outside work most of what I write is rust.
Nice. I have dabbled with it and think it has a lot of potential if it matures well.
I enjoy it quite a bit. Much more difficult learning curve than c# but really let's you dive into the details which I love.
Definitely not the right tool for every project but a joy in the right niche.
I've been trying to find an excuse to use it at work 🙂
Haha someone snuck some f# into our codebase and they've never heard the end of it
So I will learn from their mistake xD
Definitely recommend if you have a chance to use it
I've been pleasently surprised by c# (only used it here) and other than null handling I'm quite happy.