I've found answers to determining if an IList<string>
contains an element using case insensitive contains: ilist.Contains(element, StringComparer.CurrentCultureIgnoreCase)
But what I would like to do is find the element itself that corresponds within the IList to the element I'm searching for. For instance if the IList contains {Foo, Bar}
and I search for fOo
I'd like to be able to receive Foo
.
I'm not worried about multiples, and the IList doesn't seem to contain any function other than IndexOf
with doesn't help me much.
EDIT: As I'm using IList and not List, I don't have the function IndexOf, so the answer posted on here doesn't help me much :)
Thanks, Arik