I was thinking about regex as well. However without seeing more examples it is difficult to find the correct pattern. Alternatively you can go over all the string one character after another and find the problematic cases and remove them (or not add them to the StringBuilder).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.