While importing data from a flat file, I noticed that some of lines have embedded non breaking spaces (Hex: A0).
I would like to remove these, but the standard string.replace doesn't seem to work and had considered using regex to replace the string but wouldn't know what the regex would search for to remove it.
Rather than converting the whole string to hex and examining that, is there a better way?
Regex.Replace(input, "\xA0", String.Empty);
This ought to do it.
Why doesn't string.Replace work?
stringVar.Replace((char)0xA0, ' ');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With