How can I do this elegantly with C# and .NET 3.5/4?
For example, a number can be between 1 and 100.
I know a simple if would suffice; but the keyword to this
There are a lot of options:
int x = 30; if (Enumerable.Range(1,100).Contains(x)) //true if (x >= 1 && x <= 100) //true
Also, check out this SO post for regex options.