How to count list items in VB.NET

2 Answers

0 votes
Imports System
Imports System.Collections.Generic

Public Module Module1
	Public Sub Main()
		Dim list As New List(Of String)(New String() {"VB.NET", "Java", "PHP", "C++"})
 
        Console.WriteLine(list.Count)
	End Sub
End Module



' run
'
' 4
'

 



answered Sep 26, 2018 by avibootz
edited Dec 27, 2023 by avibootz
0 votes
Imports System
Imports System.Collections.Generic

Public Module Module1
	Public Sub Main()
		Dim list As New List(Of Integer)
 
        list.Add(1)
        list.Add(43)
        list.Add(7)
        list.Add(999)
        list.Add(10101)
 
        Console.WriteLine(list.Count)
	End Sub
End Module



' run
'
' 5
'

 



answered Dec 27, 2023 by avibootz
...