Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 网站建设 > ASP > 不用正则表达式来实现非大小写替换
【标  题】:不用正则表达式来实现非大小写替换
【关键字】:正则表达式
【来  源】:网络

不用正则表达式来实现非大小写替换

Your Ad Here 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

Response.Write "<p>result:"&ReplaceNoIgnoreCase("WenMingdazhou Mingda Electrical Mingda Equipment
Co.mIngda,Ltd ","Mingda")

遍历目录以及目录下文件的函数:【上一篇】
IIS5 UNICODE 编码漏洞的利用心得:【下一篇】
【相关文章】
没有相关文章
【随机文章】
  • Processes and Threads
  • Squid中的ACL(Access Control List)
  • VisualC#中托管Socket的实现方法(二) (2)
  • 用Python实现去掉文章中特定的段落
  • Python应用:文件内容分析:纵向组合列表
  • 花心
  • 我看《Atlas基础教程(Foundations of Atlas)》——写在本书上市之际
  • LINQ技术预览的新版本发布了
  • .net 应用迁移到Mono 工具 (Moma)
  • 修改oracle最大连接数的问题
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.