Function String Searches Class

RightOfFirstMatchFast

Return the portion of vLine after the first occurrence of vFind, else return vIfNotFound. If a match is found, it does not include the matching text in the string that is returned. Faster version of the RightOfFirstMatch function which uses restrictive argument types to avoid argument fix-up code.

Signature (Visual Basic / VBA)

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

Code Example

    RightOfFirstMatchFast("This is a test.", "is", vbTextCompare, "") = " is a test."
    RightOfFirstMatchFast("This is a test.", "sample", vbTextCompare, "Not found.") = "Not found."

Parameters

Parameter Description
vLine The string which is to be searched from left-to-right for the appearance of string vFind.
vFind The string which is to be searched for within string vLine. Function returns vLine if vFind is an empty string.
vCompare Specifies the type of comparison used to determine if strings match.
vIfNotFound The string which is to be returned if vFind does not appear within vLine.