您的位置:程序门 -> vb -> 资源



asp中replace的用法问题,望大家解答,在线等....


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


asp中replace的用法问题,望大家解答,在线等....[已结贴,结贴人:liangwei389]
发表于:2007-07-07 19:04:47 楼主
就是语句中的string(len(bad(i))怎么理解啊?????
function   doreplace(strrep)
dim   strtest,bad,i
strtest= "你好 ¦明天 ¦今天 ¦后天 ¦想你 "
  bad   =   split(strtest, " ¦ ")
for   i=0   to   ubound(bad)
strrep=replace(strrep,bad(i),string(len(bad(i)), "× "))
next
response.write(strrep)
end   function

doreplace( "我想你在明天你的会明白今天 ")

%>
发表于:2007-07-07 21:51:581楼 得分:20
function   doreplace(strrep)
dim   strtest,bad,i
strtest= "你好 ¦明天 ¦今天 ¦后天 ¦想你 "
  bad   =   split(strtest, " ¦ ")
for   i=0   to   ubound(bad)
strrep=replace(strrep,bad(i),string(len(bad(i)), "× "))
'在strrep中寻找bad(i)
'并用string(len(bad(i)), "× ")替换
'也就是长度为len(bad(i)的多个 "× "
next
response.write(strrep)
end   function
发表于:2007-07-08 16:37:252楼 得分:0
这样啊!谢谢,我明白了


快速检索

最新资讯
热门点击