How can I find a non-breaking space in a MySql database?
For instance between # and N:
## New Tech
I tried to select the table and click to query:
UPDATE test
SET text = replace (text, " ", "")
WHERE id = 3;
It finds 0 results and I am sure there is
With regex I can use also:
\xA0
But I do not know how to apply that in a MySql database
Non-breaking space is a space character that prevents automatic line break. It looks identical to a normal space character. By opening an UTF-8 encoded text file in binary editor, one can check that non-breaking space is 0xC2 0xA0 while normal space is 0x20 .
The TRIM() function returns a string that has unwanted characters removed. Note that to remove the leading spaces from a string, you use the LTRIM() function. And to remove trailing spaces from a string, you use the RTRIM() function.
Actually   is a character entity reference in HTML, and represents the non-breaking space character. If you want to remove it, you must include the semicolon as well.
Removing non-breaking spacesThe REPLACE( ) function replaces any non-breaking spaces with regular spaces, and then ALLTRIM( ) removes any leading or trailing regular spaces.
Non-breaking spaces are often encoded as C2A0 (in hex), so you could try:
update test set text = replace(text, UNHEX('C2A0'),'')
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