当前位置:编程学习 > asp >>

我写ASP时常用到的一些函数(2)

'//过滤脏话函数Function ChkBadWords(fString,BadWords)dim bwords bwords = split(BadWords, "|") for i = 0 to ubound(bwords) fString = Replace(fString, bwords(i), string(len(bwords(i)),"*"), 1,-1,1) nextChkBadWords = fStringEnd Function'用正则表达式突出显示字符串中查询到的单词的函数Function BoldWord(strContent,word) dim objRegExp Set objRegExp=new RegExp objRegExp.IgnoreCase =true objRegExp.Global=True
objRegExp.Pattern="(" & word & ")" strContent=objRegExp.Replace(strContent,"<font color=""#ff0000"">$1</font>" )
Set objRegExp=Nothing BoldWord=strContent End Function

补充:asp教程,高级应用
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,