R
rodchar
hey all,
string[] validOptions = { "1", "2", "3", "4", "e" };
if (Array.Exists<string>(validOptions, delegate(string s) {
return s.Contains(userInput);}))
{
Console.WriteLine("Thanks for the valid option.");
Console.ReadKey();
return true;
}
when a user just presses Enter without typing in anything it is considered a
valid option when in fact string.empty is not in the list. Any ideas?
thanks,
rodchar
string[] validOptions = { "1", "2", "3", "4", "e" };
if (Array.Exists<string>(validOptions, delegate(string s) {
return s.Contains(userInput);}))
{
Console.WriteLine("Thanks for the valid option.");
Console.ReadKey();
return true;
}
when a user just presses Enter without typing in anything it is considered a
valid option when in fact string.empty is not in the list. Any ideas?
thanks,
rodchar