VB.Net program to demonstrate the LastIndexOf() method of Array class

Hello, friend today we are going to see clearly what we are going to see in the article VB.Net program to demonstrate the LastIndexOf() method of Array class. We hope you find this article very useful.

VB.Net program to demonstrate the LastIndexOf() method of Array class

VB.Net program to demonstrate the LastIndexOf() method of Array class

'VB.NET program to demonstrate the LastIndexOf() 
'method of Array class.

Imports System

Module Module1
    Sub Main()
        Dim arr() As Integer = {10, 20, 30, 20, 30}
        Dim index As Integer

        'Search the specified item in the array and return 
        'the index of the last occurrence of an item.
        index = Array.LastIndexOf(arr, 20)

        Console.WriteLine("Index of last occurrence of item {0} is: {1}", 20, index)
        Console.WriteLine()
    End Sub
End Module
Index of last occurrence of item 20 is: 3
Press any key to continue . . .

Final Words

VB.Net program to demonstrate the LastIndexOf() method of Array class We hope you find the article useful and will see you in the next article.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment