I have looked at quite a number of related SO posts pertaining to this. I have this malformed string that contains unicode characters which I want to strip away.
string testString = "\0\u0001\0\0\0����\u0001\0\0\0\0\0\0\0\u0011\u0001\0\0\0\u0004\0\0\0\u0006\u0002\0\0\0\u0005The\u0006\u0003\0\0\0\u0017boy\u0006\u0004\0\0\0\tKicked\u0006\u0005\0\0\0\u0013the Ball\v";
I would like the following output:
The boy kicked the Ball
How can I achieve this?
I have looked at the below (With not much success):
- How can you strip non-ASCII characters from a string? (in C#)
- Converting unicode characters (C#) Testing
- How to Remove '\0' from a string in C#?
- Removing unwanted character from column (SQL Server related so not relevant in my question)