<-- Previous || Up || Next -->

Strip Last Match Verify Sub
String Replacements Class

Private Sub StripLastMatchVerify()
    'Test the StripLastMatch function.

    Debug.Assert IsNull(StripLastMatch(Null, "bc")) ' Behavior #1

    Debug.Assert IsNull(StripLastMatch("Abc", Null)) ' Behavior #2

    Debug.Assert StripLastMatch("Abc", "") = "Abc" ' Behavior #3

    Debug.Assert StripLastMatch("AbcDefGhiDefGhi", "Def", vbBinaryCompare) = "AbcDefGhiGhi" ' Behavior #4
    Debug.Assert StripLastMatch("AbcDefGhiDefGhi", "DEF", vbBinaryCompare) = "AbcDefGhiDefGhi"
    Debug.Assert StripLastMatch("AbcDefGhiDefGhi", "Def", vbTextCompare) = "AbcDefGhiGhi"
    Debug.Assert StripLastMatch("AbcDefGhiDefGhi", "DEF", vbTextCompare) = "AbcDefGhiGhi"

    Debug.Assert StripLastMatch("AbcDefGhiDefGhi", "Def") = "AbcDefGhiGhi" ' Behavior #5
    Debug.Assert StripLastMatch("AbcDefGhiDefGhi", "DEF") = "AbcDefGhiDefGhi"
    Debug.Assert StripLastMatch("AbcDefGhiDefGhi", "DEF", Null) = "AbcDefGhiDefGhi"
    Debug.Assert StripLastMatch("AbcDefGhiDefGhi", "DEF", "Joe") = "AbcDefGhiDefGhi"

End Sub

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.