user3636465
user3636465

Reputation: 15

Case insensitive search in List (of String)

I am using a List (of String) i.e.

Dim Titles As New List(Of String)

With Titles
    .Add("MR")
    .Add("MRS")
    .Add("MISS")
    .Add("DR")
    .Add("LADY")
End With

If I try to Search 'Mrs' in the above list, it won't search using 'Contains' method because of case sensitivity.

Any idea on how to make the search 'Case Insesitive' ?

Upvotes: 0

Views: 54

Answers (1)

Arek Holko
Arek Holko

Reputation: 9006

You can normalize the list beforehand, e.g. use only lowercase letters, and then do the same with the search term.

Upvotes: 1

Related Questions