删除字符串中的所有空格

use*_*487 3 sql oracle removing-whitespace

我必须删除字符串中的所有空格'5\xc2\xa0000\xc2\xa0000,5' to '5000000,5'

\n\n

我尝试了以下 3 个,但没有成功

\n\n
select replace('5\xc2\xa0000\xc2\xa0000,5',' ','') from dual; \nselect regexp_replace('5\xc2\xa0000\xc2\xa0000,5', '[[:space:]]*','') from dual;\nselect regexp_replace('5\xc2\xa0000\xc2\xa0000,5', ' ','') from dual;\n
Run Code Online (Sandbox Code Playgroud)\n\n

或者有人知道如何将此字符串 '5\xc2\xa0000\xc2\xa0000,5' 转换为数字,因为 TO_NUMBER 失败。\n谢谢

\n

Lal*_*r B 5

  1. 使用REGEXP_REPLACESPACE

Select regexp_replace('your_value', '[[:space:]]+', '') from dual:

  1. 使用REPLACE

Select REPLACE('your_value', chr(32), '') from dual: