清除字符串中指定的字符

  • 来源: 互联网 作者: 若水   2008-03-17/16:56
  • 该函数在字符串s中清除 Search(注意:如果 s 为 AAABBB,Search 为 AB。如何?) :

    Function StringCleaner(s As String, Search As String) As String

    Dim i As Integer, res As String

    res = s

    Do While InStr(res, Search)

    i = InStr(res, Search)

    res = Left(res, i - 1) & Mid(res, i + 1)

    Loop

    StringCleaner = res

    End Function


    评论 {{userinfo.comments}}

    {{money}}

    {{question.question}}

    A {{question.A}}
    B {{question.B}}
    C {{question.C}}
    D {{question.D}}
    提交

    驱动号 更多