I've been searching and trying various things for hours and can not get this simple contains function to work.
if (department.ToLower().Contains(item2.Title.ToLower()))
Here is an image of the two strings. I've copied them to notepad to compare them and they're identical.
Thanks for any advice you might have.
Here are the two string in text, copied straigth from visual studio debugger:
String 1 : "Shared Services - Technology and Information Services"
String 2 : "Shared Services - Technology and Information Services"
Edit - Added strings in text
-
and the second uses somthing longer like a En Dash–
(alt + 0150) Also if you could make a runnable example of the code not working on dotnetfiddle.net it would help us figure out your problem greatly. As of right now your question could be closed as off topic for not including any kind of runable example. – Emlenstring
s and it works. So you probably never called the method where theif
statement is located. – Quotation