Function String Searches Class

LineEndsWith

Returns True if the string vLine ends with the string vFind.

Signature (Visual Basic / VBA)

Public Function LineEndsWith( _
      ByVal vLine As Variant _
    , ByVal vFind As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Code Example

    LineEndsWith("This is a test.", "test.") = True
    LineEndsWith("This is a test.", "is") = False
    LineEndsWith("This is a test.", "") = True

Parameters

Parameter Description
vLine The string whose end is checked to see if it matches string vFind. Function returns Null if vLine is Null or cannot be fixed up to a String.
vFind The string which is to be searched for at the end of string vLine. Function returns Null if vFind is Null or cannot be fixed up to a String.
vCompare Specifies the type of comparison used to determine if the strings match. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.

Notes & Version History

Note Unlike most other string search functions, this one returns True if vFind is an empty string.