List.Count Property In VB.NET

In this article I describe about List.Count Property which property gets the total actual number of items in list.
  • 4701

Count

The Count property gets the total actual number of items in list. The following code snippet display number of items in a list.

Imports System.Text

Imports System.IO

Imports System.Collections.Generic

Module Module1

    Sub Main()

       ' Create a list of strings

        Dim AuthorList As New List(Of String)()

        AuthorList.Add("Mahesh Chand")

        AuthorList.Add("Praveen Kumar")

        AuthorList.Add("Raj Kumar")

        AuthorList.Add("Nipun Tomar")

        AuthorList.Add("Dinesh Beniwal")

        ' Count

        Console.WriteLine("Count: {0}", AuthorList.Count)

        Console.ReadLine()

    End Sub

End Module

Output:

count-property-of-list-vb.net.jpg

Categories

More Articles

© 2018 DotNetHeaven. All rights reserved.