baskaran.c
(Baskaran Chidambaram)
1
Hi Team,
I have a case where my loop has to start from 1 and end at 5, in between if some condition is matched i have to stop the loop(for).
In python:
for i in range(1,5) is the syntax i want the same kind of stuff to be implemented here.
I try with the following
- While and Do while. But i can’t able to stop the loop because Break works only with For Each
-
Enumerable.Range(Int32, Int32) Method (System.Linq) | Microsoft Learn with dot net function i try to populate it but still i can’t able to do it.
Thanks in Advance
Regards
Baskaran C
baskaran.c
(Baskaran Chidambaram)
2
I want to pass the Range in For each Activity. So that each item i retrieve from it would be single values from the range i set.
This can be done via extracting value by checking row index in for each but that would not be a good idea.
And if you already know the range why not use a while loop for that using a integer counter and retrieve what you want.
Thanks,
Prankur
Silviu
(Silviu Predan)
4
Why you say it’s not working with Enumerable.Range?
Check this example, it should work fine:
5 Likes
baskaran.c
(Baskaran Chidambaram)
5
Thanks @Silviu I have make importing namespace error. Your solution worked better
cmora
6
For future reference, the second parameter is Count, not End.
Enumerable.Range(Start, Count)
3 Likes