I have string like that:
string val = 555*324-000
now, I need to remove * and – chars, so I use that code (based on MSDN)
char[] CharsToDelete = {'*', '(', ')', '-', '[', ']', '{', '}' };
string result = val.Trim(CharsToDelete);
but the string remains the same. What’s the reason ?
Trim …Removes all leading and trailing occurrences of a set of characters specified in an array from the current String object.
You should use Replace method instead.