After I have created a list and added the contents to it, how can I find the length of the list?
+8
A:
Try this:
Int32 length = yourList.Count;
In C#, arrays have a Length
property, anything implementing IList<T>
(including List<T>
) will have a Count
property.
Andrew Hare
2009-11-08 23:27:31