var specialCharacters= ["~", "&", "è",'*'];
string entityName ="abc def & * ()@"; entityName=entityName.ToStr().Replace(" ", ""); var allowablespecialCharacters = @"#$%^*"; string patterns = @"[^A-Za-z0-9" + specialCharacters + "]"; var b = Regex.Matches(entityName, patterns, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled); return b.Count > 0 ? true : false;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)