ASP如何将回车和空格一同输入到数据库并且可以表达出来呢?

ASP如何将回车和空格一同输入到数据库并且可以表达出来呢?,第1张

是存数据库时用的

假如取的数据放在content中,

content=Replace(content,chr(10),"<br>")

content=Replace(content,chr(13)&chr(10),"<p>")

content=Replace(content,chr(10)&chr(13),"</p>")

content=Replace(content,"

","&nbsp")

&nbsp代表空格

加一个过滤

Function text_chg(aBody)

text_chg = replace(aBody,"<","<")

text_chg = replace(text_chg,">",">")

text_chg = replace(text_chg,chr(39),"'")

text_chg = replace(text_chg,chr(34),""")

text_chg = replace(text_chg,chr(13)&chr(10),"<br>")

text_chg = replace(text_chg," "," ")

text_chg = trim(text_chg)

text_chg = replace(text_chg," "," ")

End Function

这个函数就可以,怎么使用不用我说了吧


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/9972458.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-03
下一篇 2023-05-03

发表评论

登录后才能评论

评论列表(0条)

保存