I have a string in Python like this:
u'\u200cHealth & Fitness'
How can i remove the
\u200c
part from the string ?
In python, to remove Unicode character from string python we need to encode the string by using str. encode() for removing the Unicode characters from the string.
To remove zero-width space characters from a JavaScript string, we can use the JavaScript string replace method that matches all zero-width characters and replace them with empty strings. Zero-width characters in Unicode includes: U+200B zero width space. U+200C zero-width non-joiner Unicode code point.
The \u200c character is ZERO WIDTH NON-JOINER.
You can encode it into ascii
and ignore errors:
u'\u200cHealth & Fitness'.encode('ascii', 'ignore')
Output:
'Health & Fitness'
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