替换字符

myveremy 2005-06-20 12:45:36
Program="12312312&1231231231"
if instr(Program,"&")>0 then
replace(program,"&","ab")
else respose.write "b"
end if
怎么替换不了啊!
...全文
93 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
itzhiren 2005-06-20
  • 打赏
  • 举报
回复
能替换呀:
<%
Program="12312312&1231231231"
if instr(Program,"&")>0 then
Program = replace(program,"&","ab")
response.write Program
else
response.write "b"
end if

%>
wangwm 2005-06-20
  • 打赏
  • 举报
回复
Program="12312312&1231231231"
if instr(Program,"&")>0 then
program = replace(program,"&","ab")
Response.write program
else
Response.write "b"
end if
千念陌 2005-06-20
  • 打赏
  • 举报
回复
Program="12312312&1231231231"
if instr(Program,"&") then
replace(program,"&","ab")
else
respose.write "b"
end if
xiaosaye 2005-06-20
  • 打赏
  • 举报
回复
...
if instr(Program,"&")>0 then
replace(program,"&","ab") '你这条语句进行替换后没有把新的值赋给Program
else respose.write "b"
...
zhangxian_gege 2005-06-20
  • 打赏
  • 举报
回复
Program="12312312&1231231231"
if instr(Program,"&")>0 then
response.write replace(program,"&","ab")

else
respose.write "b"
end if

可以替换的 ,只是你没有写出来而已
ronakitty 2005-06-20
  • 打赏
  • 举报
回复
得把替换后的值付给一个变量啊!
a=replace(program,"&","ab")

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧