Logo

Programming-Idioms

History of Idiom 117 > diff from v47 to v48

Edit summary for version 48 by silver-dragon:
[VB] changed the var names to match the lead paragraph

Version 47

2019-09-30, 14:23:14

Version 48

2019-09-30, 19:35:52

Idiom #117 Get list size

Set n to the number of elements of list x.

Illustration

Idiom #117 Get list size

Set n to the number of elements of list x.

Illustration
Extra Keywords
length
Extra Keywords
length
Code
Dim ItemList As New List(Of String)(New String() {"one", "two", "three"})
Console.WriteLine(ItemList.Count)
Code
Dim x As New List(Of String)(New String() {"one", "two", "three"})
Dim n as Integer = x.Count
Doc URL
https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.count?view=netframework-4.8#System_Collections_Generic_List_1_Count
Doc URL
https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.count?view=netframework-4.8#System_Collections_Generic_List_1_Count