VB.net Program to Check the Specified Item Is Exits in the Queue Collection or Not

You are currently viewing VB.net Program to Check the Specified Item Is Exits in the Queue Collection or Not

VB.Net program to check the specified item is exits in the Queue collection or not

'VB.Net program to check the specified item exists 
'in the Queue collection or not.

Imports System
Imports System.Collections

Module Module1
    Sub Main()

        Dim queue As New Queue(5)

        queue.Enqueue("India")
        queue.Enqueue("USA")
        queue.Enqueue("UK")
        queue.Enqueue("CHINA")

        If (queue.Contains("India")) Then
            Console.WriteLine("Item exists in queue")
        Else
            Console.WriteLine("Item does not exist in queue")
        End If
    End Sub
End Module
Item exists in queue
Press any key to continue . . .

Ranjith Kumar

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

Leave a Reply