如何去除字段内容前后的换行回车?
ASP+access
我的数据库中的某个表中,有个字段是 【备注】类型的;
存储的内容 前后会带有若干个换行回车符,
相当于 data=vbcrlf&vbcrlf&vbcrlf&".............................内容............"&vbcrlf&vbcrlf&vbcrlf
我现在想把内容前后的换行回车 去除掉。怎么去?
------解决方案--------------------actor=replace(actor,c,"<f>"&c&"</f>")
actor=replace(actor,"</f><f>","")
------解决方案--------------------trim或者replace都可以啊
trim(rs("ziduan"))
replace(rs("ziduan")," ","")
------解决方案--------------------
VBScript code
data = vbcrlf&vbcrlf&vbcrlf&".............................内容............"&vbcrlf&vbcrlf&vbcrlf
Response.Write trims(data)
Function trims(s)
Dim r
Set r = New RegExp
r.IgnoreCase = True
r.Global = True
r.Pattern = "^\s+"
s = r.Replace(s, "")
r.Pattern = "\s+$"
s = r.Replace(s, "")
trims = s
End Function