gpt4 book ai didi

sql-server - LTRIM 和 RTRIM 精确修剪哪些字符?

转载 作者:行者123 更新时间:2023-12-01 06:17:47 25 4
gpt4 key购买 nike

LTRIMRTRIM are documented to trim "blanks" .哪些字符被视为“空白”?

最佳答案

好问题。虽然有很多whitespace Unicode定义的字符,只去掉一个空格(0x0020):

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 );

(同样适用于RTrim。)

关于sql-server - LTRIM 和 RTRIM 精确修剪哪些字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35244986/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com