Linked Questions
175 questions linked to/from How to make '.Contains(string)' case insensitive
77 votes
3 answers
175k views
How to make String.Contains case insensitive? [duplicate]
How can I make the following case insensitive? myString1.Contains("AbC")
46 votes
5 answers
50k views
Find a substring in a case-insensitive way - C# [duplicate]
With Contains() method of String class a substring can be found. How to find a substring in a string in a case-insensitive manner?
17 votes
7 answers
33k views
Case Insensitive comparison in C# [duplicate]
I am comparing two strings using following code string1.Contains(string2) but i am not getting results for case insensitive search. Moreover I cant use String.Compare coz i dont want to match the ...
9 votes
1 answer
16k views
Linq IEqualityComparer<string> Ignore Case [duplicate]
I am sorting a list of elements: var matchEle = listOfElements.Where(e => e.Properties().Any(p => p.Name.Contains("Key", Asking for IEqualityComparer))).First(); I am used to just going ...
2 votes
2 answers
7k views
How to determine if string contains specific substring ignoring the case sensitive [duplicate]
I want to check whether string below contains top/ TOP/toP/ Top/TOp/ Top in c#. My code is like string str = null; str = "CSharp Top11111 10 BOOKS"; if (str.Contains("top") == true) ...
0 votes
2 answers
16k views
Make String.Contains() case insensitive [duplicate]
I have made a software in vb.net that has a specific purpose. It has to compare two strings at a particular point, say they are x and y. The code is If x.Contains(y) then 'do things here End If If y ...
-2 votes
5 answers
876 views
How to test for Case-Insensitive StringA.Contains(StringB)? [duplicate]
How can I test whether a substring is contained in other, but case-insensitively? string1.Contains(string2) is not case insensitive. if there is no existing method, I would want to write a optimized ...
4 votes
3 answers
1k views
C# Case insensitive string comparison [duplicate]
I have a list that holds a few strings(names). For this example. It will hold: TeSt1 TeSt2 TeSt3 And I'm trying to check if that list has one of those. And I'm doing this like this at the moment: if (...
-5 votes
2 answers
7k views
Is .Contains case-sensitive in .Net? [duplicate]
Is the string-method .Contains case-sensitive in .Net? For example: string str1 = "tEst"; string str2 = "Te"; Boolean bool = str1.Contains(str2);
9 votes
1 answer
403 views
c# If else statement with case insensative [duplicate]
I have this if else statement which is assigned to compare results from a text box to a list of context. I am wondering how do i make it such that it is case insensitive ? value = textbox1.Text; if (...
0 votes
3 answers
2k views
Make string comparison case-insensitive for .net winforms application [duplicate]
Need to have string comparison case insensitive for .net winforms application. It is not a problem when strings are compared in my code, but I need this everywhere. For ex.: there is combobox with ...
1 vote
2 answers
3k views
Filter an IQueryable with case insensitive. [duplicate]
IQueryable<MyModel> myList = GetListMyModel().AsQueryable(); myList = myList.Where(m => m.Name.Contains('John')); I want to return everything with Name = 'John' or 'john' or 'JOHN' (case-...
0 votes
4 answers
331 views
Find word in string with random digits before and after [duplicate]
I tried several solutions from the internet an worked myself through some tutorials but I am not able to make it work. I try to match a word in a string with random letters, numbers or dots before and/...
-1 votes
2 answers
1k views
Check if a Windows ListBox contains a string c# ignorecase? [duplicate]
if (!lstFieldData.Items.Contains(ItemValue)) MessageBox.Show(ItemValue + "Item not found."); Above code is to get the list of items that is not in the list. Now i want to check this with ...
3 votes
2 answers
341 views
.Net Core query case-insensitive string data in list from MongoDb [duplicate]
I have been working out for a case-insensitive search for hours and I still can`t find a solution... I have data stored in MongoDB and formatted like this : { id: 12345, name: "foo", area: ["...