Iterating generic list using indexes (C#) -


I have switched away from a lot of normal types and array types, but now and again I want to iterate through something This is necessary where it is easy to index like those sequences like they provide arrays. Generic lists are great because they keep the sequence of things internally in the same way as they are in the order of things cast, they are dynamic and come in very useful ways, but can I jump in with the circles like ? Can I say, repeat a general list for the loop, and on some indexes, there is no value in it between the previous or future indexed values, iterate all the values?

For example using an array:

 for  (int i = 50; i! = 0; -i) {if (myArray [i] = = 1 & amp; amp; amp;; 5 & lt; = 50) {myArray [i + 5] = Arraye [I + 5] + 2; }}    

Yes, you can do this with the list like Arrays List Indices Which function similar to the array indicator. Have you tried to do this and it is not working?

  var lists = exclusive Category (0, 51) .Oolist (); (Var i = 50; i! = 0; -i) {if (lists [i] == 1 & amp; amp; amp;; 5 & lt; = 50) {lists [i + 5] = lists [I + 5] + 2; }}    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -