bool usernamecheckchar = txboxName.Text.Any(x => !char.IsLetter(x)); if (usernamecheckchar == true) { //entered text may contain spaces and characters only bool usernamecheckspaces = txboxName.Text.Contains(" "); if (usernamecheckspaces == true) { } else { } } else { }
if (!Regex.Match(txboxName.Text, @"[^\sa-zA-Z]").Success) { // Spaces and alphabetics only ... }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)