日期:2014-05-17  浏览次数:20735 次

在ASP中实现句子中字符替换的函数
    前几天SEO优化页面的时,主页W3C通不过,html中的标签大写不能转换成小写,找了很多函数都不能实现,不过发现了一个可以转换句子中字符的函数,如下:
  Function ReplaceTest(patrn, replStr)
Dim regEx, str1 ' 建立变量。
str1 = "The quick brown fox jumped over the lazy dog."
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = True
ReplaceTest = regEx.Replace(str1, replStr)
End Function
response.write(ReplaceTest("fox", "cat"))

ps: 自己在传上ftp测试,是可以转换的,先留下了,以后找需要的时候,再拿来用