asp实现非大小写的替换函数

时间:2010-05-19 21:23:00 

asp替换函数如下:

Function ReplaceNoIgnoreCase(str,replStr)
      If len(replStr)<1 or str="" Then
            ReplaceTest=str
            Exit function
      End If
      
      Dim LoopN
      LoopN=1
      
      Dim TmpStr,inStrN,LenreplStr,Ustr,UreplStr
      LenreplStr = Len(replStr)
      TmpStr = str
      Ustr = Ucase(str)
      UreplStr = Ucase(replStr)
      str=""
      
      inStrN = inStr(Ustr,UreplStr)      
      
      Do While inStrN>0 and TmpStr<>""
            LoopN = LoopN+1
            If LoopN>10 Then Exit Function
            str=str & Left(TmpStr,inStrN-1)
            TmpStr = Mid(TmpStr,inStrN)
            UStr = Mid(UStr,inStrN)
            str=str & "<font color=ff0000>" & Left(TmpStr,LenreplStr) & "</font>"
            TmpStr = Mid(TmpStr,LenreplStr+1)
            UStr = Mid(UStr,LenreplStr+1)
            inStrN = inStr(Ustr,UreplStr)
            If inStrN<1 Then str=str&TmpStr
      Loop
      ReplaceTest = str
End Function

标签:替换,函数,asp
0
投稿

猜你喜欢

  • 使用ASP脚本命令重新启动服务器

    2008-10-10 11:53:00
  • 删除数据库中重复数据的两个方法

    2008-01-01 19:16:00
  • asp模板解析类模块(支持if,function,loop及解析缓存)

    2008-08-11 13:06:00
  • Shellcode加密解密函数

    2009-04-24 11:18:00
  • 一个较复杂的字符串截取函数

    2009-11-02 10:45:00
  • 关于Youtube URL的十个技巧

    2009-04-21 13:19:00
  • 100%点击区的滑动门

    2007-06-14 22:00:00
  • Oracle 语句优化分析说明第1/2页

    2009-09-18 13:23:00
  • DBA经验:如何进行MySQL数据库表的故障检测

    2009-02-12 17:37:00
  • 网页代码中键盘操作相关标签教程

    2010-03-18 15:56:00
  • Session.TimeOut的最大取值是1440,超出会报错

    2011-03-31 11:19:00
  • 简单的在线调试服务端js代码的asp源码

    2008-04-23 13:30:00
  • on error goto (Vbscript)和try catch

    2008-08-04 13:22:00
  • CSS hacks与争议

    2007-11-19 12:56:00
  • SqlServer 索引自动优化工具

    2012-10-07 10:41:09
  • 浏览器 cookie 限制

    2008-05-23 13:09:00
  • ACCESS转SQL Server2000需要注意的问题

    2007-11-18 15:25:00
  • 优化MySQL数据库查询的三种方法

    2009-03-09 15:19:00
  • 如何在Frontpage中定义CSS样式

    2008-08-02 12:32:00
  • 定义列表: DL DT DD

    2009-05-06 13:08:00
  • asp之家 网络编程 m.aspxhome.com