LTRIM
and RTRIM
are documented to trim "blanks". What characters are considered "blank" exactly?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Good question. Although there are many whitespace characters defined in Unicode, only a space (0x0020) is removed:
with Characters as (
select NChar( 0 ) as Character
union all
select NChar( Unicode( Character ) + 1 )
from Characters
where Unicode( Character ) < 65535 ),
CharacterMap as (
select Unicode( Character ) as [UnicodePoint], Character,
1 - Len( LTrim( Character ) ) as [Whitespace]
from Characters )
select UnicodePoint, Character, Whitespace
from CharacterMap
where Whitespace = 1
option ( MaxRecursion 0 );
(The same applies to RTrim
.)