How can I validate a string using Regular Expressions to only allow alphanumeric characters in it?
(I don\'t want to allow for any spaces either).
In order to check if the string is both a combination of letters and digits, you can re-write @jgauffin answer as follows using .NET 4.0 and LINQ:
if(!string.IsNullOrWhiteSpace(yourText) && yourText.Any(char.IsLetter) && yourText.Any(char.IsDigit)) { // do something here }