Suppose I have a group of unwanted characters & " > < { } ( )
and I want to validate that a given string does not contains those characters, for now I wrote function like:
bool IsStringValid(string s){
if(s.Contains("&")| s.Contains(">")...)
return false;
return true;
}
How can I write it more elegant? for example in regex?