Trim spaces in string - LTRIM RTRIM not working

后端 未结 8 1794
你的背包
你的背包 2021-02-03 19:14

I tried this code -

UPDATE Table
SET Name = RTRIM(LTRIM(Name))

Data type of Name is varchar(25)

None of the leading and t

8条回答
  •  失恋的感觉
    2021-02-03 20:05

    Use this to identify the offending character:

    select ascii(substring(' Your string with leading invisible character',1,1));
    -- returns something like 160
    

    Use this to replace the offending character

    replace(' Your string with leading invisible character', char(160),'')
    

提交回复
热议问题