I have something like this:
string configKeys = "othewr|RDX|MDX";
and wrote a code like this to see if value "OTHER" exists in that list
List<string> values = configKeys.Split('|').ToList();
var b = values.Find(item => item.Trim().ToUpper() == "OTHER").FirstOrDefault();
but for example because I have typed it wrong "othewr" so it crashes, but just want it to tell me if it exists or not as a boolean
. How can I change the code to do that and not crash?