Check if string contains only letters and/or numbers

Its super easy to validate if a string does not have any special characters in it.

Bool isValid(string inputText)
{
     return inputText.All(Char.IsLetterOrDigit);
}

Leave a Reply