I have this:
if (input.Text.ToUpper() == \"STOP\")
But there are so many possible values that I wouldn\'t be able to specify them all sepa
Perfect situation for a string extension
Add this to a new file
namespace appUtils
{
public static class StringExtensions
{
public static bool In(this string s, params string[] values)
{
return values.Any(x => x.Equals(s));
}
}
}
and call from your code in this way
if(input.Text.In("STOP", "END", "NO", "YES") == true)
// ... do your stuff