Is there a reason for this? I am asking because if you needed to use lots of empty chars then you get into the same situation as you would when you use lots of empty strings.
Edit: The reason for this usage was this:
myString.Replace ('c', '')
So remove all instances of 'c's from myString.
If you want to remove characters that satisfy a specific condition, you may use this:
(This will leave only the uppercase characters in the string.)
In other words, you may convert the string to an
IEnumerable<char>
, make changes on it and then convert it back to a string as shown above.Again, this enables to not only remove a specific char because of the lambda expression, although you can do so if you change the lambda expression like this:
c => c != 't'
.