I have
public readonly IEnumerable<string> QuestionStrings = new List<string>
{
// okay?,are you okay?,what to do?
};
I am reading input from user and if the input matches one of the questions listed above, I want to send the user a specific message .
My problem is that I want the comparison to be case insensitive and question mark insensitive .
So if the user enters okay?, Okay?, okAy or okay I want to treat all these messages the same and send the same specific message to user
I was able to compare the string regarding case insensitive
QuestionStrings.Contains(userInput, StringComparer.OrdinalIgnoreCase);
but I am couldn't find out a way to ignore the question mark
Any way to do that? "other than checking the input from user if it contains ? or not at the end"