How to case insensitive check if list contains a string in VB.NET

1 Answer

0 votes
Imports System
Imports System.Linq
Imports System.Collections.Generic

Public Class Program
	Public Shared Sub Main()
        Dim list = New List(Of String) From {
            "python",
			"vb.net",
            "c",
            "c++",
            "java",
            "php",
            "go"
        }
		
        Console.WriteLine(list.Contains("JAVA", StringComparer.InvariantCultureIgnoreCase))
    End Sub
End Class




' run:
'
' True
'

 



answered Aug 11, 2023 by avibootz

Related questions

1 answer 150 views
1 answer 125 views
1 answer 87 views
2 answers 92 views
1 answer 176 views
...