0

I have the following code:

 Dim query = CsteList.Where(Function(i) i.Text.Contains(FilterTextBox.Text.Trim))
  1. FilterTextBox.Text = "HELLO"
  2. FilterTextBox.Text = "hello"
  3. FilterTextBox.Text = "HeLLo"

whether input as "HELLO" or "hello" my code should filter respective word

Namitha
  • 81
  • 1
  • 7
  • 4
    Does this answer your question? [Case insensitive 'Contains(string)'](https://stackoverflow.com/questions/444798/case-insensitive-containsstring) – SomeBody Feb 19 '21 at 14:48
  • If you don't use .Net Core 2.1+ or .Net 5 (which provide a new StringComparison overload to Compare(String)), you can use something like: `Dim query = CsteList.FirstOrDefault(Function(item) item.Text.IndexOf(FilterTextBox.Text, StringComparison.InvariantCultureIgnoreCase) >=0)` – Jimi Feb 19 '21 at 14:57

0 Answers0