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
投稿

猜你喜欢

  • python数据爬下来保存的位置

    2021-01-29 20:49:19
  • sqlserver中delete、update中使用表别名和oracle的区别

    2024-01-19 15:21:49
  • Oracle Index 的三个问题

    2024-01-14 20:20:40
  • python简单实现插入排序实例代码

    2021-11-27 14:33:04
  • python3 unicode列表转换为中文的实例

    2021-02-13 20:06:06
  • asp实现本周的一周时间列表的代码

    2011-04-06 10:45:00
  • MYSQL 批量替换之replace语法的使用详解

    2024-01-21 19:52:35
  • 详解Python魔法方法之描述符类

    2023-12-17 04:59:59
  • Python爬虫教程使用Scrapy框架爬取小说代码示例

    2023-01-22 15:58:08
  • pandas 数据索引与选取的实现方法

    2021-07-09 17:37:44
  • python使用KNN算法手写体识别

    2022-06-28 05:30:56
  • 对python3 urllib包与http包的使用详解

    2022-08-04 15:20:14
  • Python编程求质数实例代码

    2021-12-03 23:17:18
  • Dreamweaver制作网页幻灯片效果

    2010-07-06 13:48:00
  • PyTorch实现更新部分网络,其他不更新

    2022-06-15 21:01:33
  • 深刻理解Oracle数据库的启动和关闭

    2010-07-26 13:08:00
  • python实现excel公式格式化的示例代码

    2021-08-09 17:27:52
  • Python线程之定位与销毁的实现

    2023-09-25 11:47:19
  • Golang 操作TSV文件的实战示例

    2023-07-18 06:46:01
  • Django中信号signals的简单使用方法

    2023-08-18 08:49:49
  • asp之家 网络编程 m.aspxhome.com