Function String Searches Class

LineBeginsWithFast

Returns True if the string vLine begins with the string vFind. Faster version of the LineBeginsWith function which uses restrictive argument types to avoid argument fix-up code.

Signature (Visual Basic / VBA)

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

Code Example

    LineBeginsWithFast("This is a test.", "THIS", vbTextCompare) = True
    LineBeginsWithFast("This is a test.", "IS", vbTextCompare) = False
    LineBeginsWithFast("This is a test.", "", vbTextCompare) = True

Parameters

Parameter Description
vLine The string whose beginning is checked to see if it matches string vFind.
vFind The string which is to be searched for at the beginning of string vLine.
vCompare Specifies the type of comparison used to determine if the strings match.

Notes & Version History

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