c# check if textbox contains only characters code example
Example: c# check if string is only letters and numbers
if (textVar.All(c => Char.IsLetterOrDigit(c))) {
// String contains only letters & numbers
}
if (textVar.All(c => Char.IsLetterOrDigit(c))) {
// String contains only letters & numbers
}