顺德龙江房价:ASP中使用replace的问题

来源:百度文库 编辑:神马品牌网 时间:2024/04/20 08:16:34
word=requset("word")
if not rs.eof then
do while not rs.eof
word1=rs("word1")
replace(title1,"word",word1) '我这里需要一个循环,来多次使用REPLACE,替换调word中的字符,word
replace(content1,"word",word1)
rs.movenext
loop
end if

replace(text,"","")的格式中是不是只能用字符?
有什么办法实现没有?

word,和word1 都不是字符串哦!! 是赋值了的!!!

问题就在这里!!!!!
:title1=replace(title1,"word",word1)
content1=replace(content1,"word",word1)
然后打印title1和content1就行了

这样没有报错,但是没有过滤掉字符

title1=replace(title1,word,word1)
content1=replace(content1,word,word1)
然后打印title1和content1就行了,他们的脏话内容已经被过滤了。

你的title1和content1都必须是一个被赋了字符串值的变量才行~!

word=requset(\"word\")
if not rs.eof then
do while not rs.eof
word1=rs(\"word1\")
title1=replace(title1,word,word1)
content1=replace(content1,word,word1)
rs.movenext
loop
end if

word,和word1 都不是字符串哦!! 是赋值了的!!!

那你用 replace(title1,word,word1) 这样写,在这之前最好把
title1 也赋值