I want to find whether a string contains any of the special characters like !,@,#,$,%,^,&,*,(,)....etc.
How can I do that without looping thorugh all the charact
Here is a short solution to check for special chars using LINQ
private bool ContainsSpecialChars(string value) { var list = new[] {"~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "+", "=", "\""}; return list.Any(value.Contains); }