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

Strip Matching End Line Fast Function
String Replacements Class

Public Function StripMatchingEndLineFast( _
      ByRef vLine As String _
    , ByRef vFind As String _
    , ByRef vCompare As VbCompareMethod _
    ) As String

Strip vFind from vLine only if it appears at the end of vLine, otherwise return the string vLine unchanged.
Faster version of the StripMatchingEndLine function which uses restrictive argument types to avoid argument fix-up code.

Examples:
    StripMatchingEndLineFast("This is a test.", "test.", vbTextCompare) = "This is a "
    StripMatchingEndLineFast("This is a test.", " is ", vbTextCompare) = "This is a test.
    StripMatchingEndLineFast("This is a test.", "", vbTextCompare) = "This is a test.
See also:
    StripMatchingEndLine Function
    LineEndsWithFast Function
    StripMatchingBeginLineFast Function
vLine: The string whose end is to be removed if it matches string vFind.
vFind: The string which is to be removed from the end of vLine if present. Function returns vLine unchanged if vFind is an empty string (Behavior #1).
vCompare: Specifies the type of comparison used to determine if the strings match (Behavior #2).

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