小问

skyboy0720 2003-10-21 12:09:41
Function filterContent( fcounter )
filterContent=replace(fcounter,"'","''",1)
'filterContent=replace(fcounter,"<","<",1)
'filterContent=replace(fcounter,">",">",1)
End Function
Infor = filterContent ( Trim ( Request.Form ( "infor" ) ) ) '
Response.Write Infor

我想问问,那1 是什么意思,谁能帮我解释这个函数的参数!!

我还想过滤<,结果我把“filterContent=replace(fcounter,"<","<",1)”
加上去以后,'就不能过滤了,怎么回事

还有更好的过滤方法吗?!
...全文
38 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
huhan3 2003-10-21
  • 打赏
  • 举报
回复
表示替换次数
huhan3 2003-10-21
  • 打赏
  • 举报
回复
Replace()
 FUNCTION: Returns a string in which a specified sub-string has been
replaced with another substring a specified number of times.
 SYNTAX: Replace(strToBeSearched, strSearchFor, strReplaceWith [, start
][, count ][, compare]]])
 ARGUMENTS: strToBeSearched is a string expression containing a sub-
string to be replaced; strSearchFor is the string expression to search for
within strToBeSearched; strReplaceWith is the string expression to replace
sub-string strSearchFor; start (optional) is the numeric character
position to begin search; count (optional) is a value indicating the
comparision constant.
 EXAMPLE: <%
strTest = "This is an apple!"
response.write Replace(strTest, "apple", "orange")
%>
 RESULT: This is an orange!
xiaobird1 2003-10-21
  • 打赏
  • 举报
回复
替换1次的意思,默认值是-1,表示替换所有
avonqin 2003-10-21
  • 打赏
  • 举报
回复
1表示大小写相同,0表示大小写不相同,默认为1。
replace(fcounter,"<","<"),可以过滤"<"
skyboy0720 2003-10-21
  • 打赏
  • 举报
回复
不是哦!好象也可以!!
xiaobird1 2003-10-21
  • 打赏
  • 举报
回复
如果此参数设为1,
替换的话,只会执行一次替换,
再检测到符合条件的字符,也不会执行。
skyboy0720 2003-10-21
  • 打赏
  • 举报
回复
什么叫替换次数,不太明白,能详细点吗

28,390

社区成员

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

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