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

VB.Net program to demonstrate the BinarySearch() method of Array class Article has many meanings. We are going to know this topic clearly through this article. We hope you like this article.

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

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

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

Imports System

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

        index = Array.BinarySearch(arr, 30)

        If (index < 0) Then
            Console.WriteLine("Item not found")
        Else
            Console.WriteLine("Item {0} find at index: {1}", 30, index)
        End If
    End Sub
End Module
Item 30 find at index: 2
Press any key to continue . . .

Final Words

VB.Net program to demonstrate the BinarySearch() method of Array class We got to know our topic very clearly. And if you have any doubts about this article you can let us know your doubts via comment.

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

Share on:

Leave a Comment