how to get values of object list using for loop in c# -


i have list of object type in c#. want values of each element using loop . have searched lot on web found foreach loop method.

you can loop on list using for shown below, although using foreach cleaner

for (var = 0; < list.count; i++) {     var xcor = list[i].xcor;     var ycor = list[i].ycor; } 

the equivalent foreach loop this:

foreach (var point in list) {    var xcor = point.xcor;    var ycor = point.ycor } 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -