I am new to C#. Say that I have a string like this:
string test = 'yes/, I~ know# there@ are% invalid£ characters$ in& this* string^";
If I wanted to get rid of a single invalid symbol, I would do:
if (test.Contains('/'))
{
test = test.Replace("/","");
}
But is there a way I can use a list of symbols as argument of the Contains
and Replace
functions, instead of deleting symbols one by one?