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

php - Extract Text from HTTP referer -

Receive udp packets in android gstreamer -

authentication - ASP.NET Core 1.0. Bearer Token, cannot access custom claims -