How to write C# case insensitive LIKE statement for SQLIte using ICU extension?

Alderven picture Alderven · Aug 18, 2014 · Viewed 10.9k times · Source

SQLite has limitation on using LIKE for non-ASCII symbols. ICU extension solves this problem. How to write code in C# for creating following case insensitive statement:

SELECT * FROM Persons WHERE surname LIKE '%Пупкин%'

P.S. If there is another solution for using in C# LIKE statement for non-ASCII symbols please provide it.

Answer

Hiệp Lê picture Hiệp Lê · Aug 18, 2014
var result = people.Where(x=> x.Surname.IndexOf(searchText, StringComparison.InvariantCultureIgnoreCase) > -1);