Logo

Programming-Idioms

History of Idiom 117 > diff from v14 to v15

Edit summary for version 15 by :
New Csharp implementation by user [zehberk]

Version 14

2016-02-16, 16:13:51

Version 15

2016-02-16, 18:06:53

Idiom #117 Get list size

Set n to the number of elements of list x.

Idiom #117 Get list size

Set n to the number of elements of list x.

Imports
System.Collections.Generic;
Code
int n = x.Count;
Comments bubble
If x is of type IEnumerable, use Count() instead.
Doc URL
https://msdn.microsoft.com/en-us/library/27b47ht3%28v=vs.110%29.aspx