如题,如何实现AaBb替换后变成Bb不知道有没有自带的函数

解决方案 »

  1.   

    MsgBox Replace("AaBb", "a", "", , , vbTextCompare)
      

  2.   

    本帖最后由 bcrun 于 2011-03-31 15:29:01 编辑
      

  3.   

    MsgBox Replace("AaBb", "a", "", , , vbTextCompare)
    MsgBox Replace("AaBb", "a", "", , , vbBinaryCompare)
    MsgBox Replace("AaBb", "a", "", , , vbDatabaseCompare)看区别还不如看msdn,最后一个同样的结果,可是你会用吗?光标定位在replace上然后按F1
      

  4.   

    推荐另外一个方法,比vb内置函数效率高不少:
    Dim reg As Object
    Set reg = CreateObject("vbscript.regExp")
    reg.Global = True
    reg.IgnoreCase = True
    reg.MultiLine = True
    reg.Pattern = "a"
    MsgBox reg.Replace("AaBb", "")
    参考:
    http://tieba.baidu.com/f?kz=1038863264