Questions tagged «string-manipulation»

1
在SQL Server中本地解码Base64字符串
我varchar在SQL Server的表中有一列,其中包含一个base64编码的文本字符串,我想将其解码为等效的纯文本 SQL Server是否有任何本机功能来处理此类事件? 一个示例base64字符串: cm9sZToxIHByb2R1Y2VyOjEyIHRpbWVzdGFtcDoxNDY4NjQwMjIyNTcxMDAwIGxhdGxuZ3tsYXRpdHVkZV9lNzo0MTY5ODkzOTQgbG9uZ2l0dWRlX2U3Oi03Mzg5NjYyMTB9IHJhZGl1czoxOTc2NA== 解码为: role:1 producer:12 timestamp:1468640222571000 latlng{latitude_e7:416989394 longitude_e7:-738966210} radius:19764

6
修剪空白(空格,制表符,换行符)
我正在使用SQL Server 2014,需要从列内容的开头和结尾清除空格,其中空格可以是简单的空格,制表符或换行符(\n和\r\n);例如 ' this content ' should become 'this content' ' \r\n \t\t\t this \r\n content \t \r\n ' should become 'this \r\n content' 等等。 我只能用 UPDATE table t SET t.column = LTRIM(RTRIM(t.column)) 但在其他情况下,则无效。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.