巫师3 突变诱发物代码:<%=replace(rs("content"),chr(13)&chr(10),"<br>")%>数据库内容为空时出现___无效使用 Null: 'Replace'

来源:百度文库 编辑:中科新闻网 时间:2024/05/04 12:16:02
请大虾帮忙,给个解决的IF语句

是我告诉你这么写的吧。嗯,你用IF判断一下,就是

<%if rs("content")="" or isnull(rs("content")) then%>
<%=replace(rs("content"),chr(13)&chr(10),"<br>")%>
<%end if%>

这样了。就不会出错了

<%content1=rs(\"content\")
if content1<>\"\" then content1=replace(content1,chr(13)&chr(10),\"<br>\") end if
response.write content1%>

<%if rs("content")="" or isnull(rs("content")) then%>
<%=replace(rs("content"),chr(13)&chr(10),"<br>")%>
<%end if%>

这是一个替换的语句
返回字符串,其中指定数目的某子字符串被替换为另一个子字符串。

Replace(expression, find, replacewith[, compare[, count[, start]]])
参数
expression
必选项。字符串表达式包含要替代的子字符串。
Find
必选项。被搜索的子字符串。
Replacewith
必选项。用于替换的子字符串。
Start
可选项。expression 中开始搜索子字符串的位置。如果省略,默认值为 1。在和count 关联时必须用
count
可选项。执行子字符串替换的数目。如果省略,默认值为 -1,表示进行所有可能的替换。在和 start 关联时必须用。
Compare
可选项。指示在计算子字符串