...
- 说明:该方法输入一个带有英文单引号('),双引号("),反斜杠(\)的字符串时,会强行转义为原样输出
示例:
Code Block language go str:=`aaaa`'aa'"bb"\dddd`cc\r\n\d\t` rsStr:=gstr.AddSlashes(str) fmt.Println(rsStr) //输出结果: aaaa \'aa\'\"bb\"cc\\r\\ddddn\\d\\t
...
示例:
Code Block | ||
---|---|---|
| ||
str:=`aaaa`'aa'"bb"\dddd`cc\r\n\d\t` rsStr:=gstr.AddSlashes(str) fmt.Println(rsStr) //输出结果: aaaa \'aa\'\"bb\"cc\\r\\ddddn\\d\\t |