c# check whether a string contains only alphabets and characters only code example
Example 1: how to check that string has only alphabet in c#
Regex.IsMatch(input, @"^[a-zA-Z0-9]+$");
Example 2: how to check that string has only alphabet in c#
Regex.IsMatch(input, @"^[a-zA-Z]+$");