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

Right Of First Match Function
String Searches Class

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

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.

Examples:
    RightOfFirstMatch("This is a test.", "is") = " is a test."
    RightOfFirstMatch("This is a test.", "sample") = "This is a test."
    RightOfFirstMatch("This is a test.", "sample", Null, "Not found.") = "Not found."
    RightOfFirstMatch("This is a test.", "") = "This is a test."
See also:
    RightOfFirstMatchFast Function
    RightOfLastMatch Function
    LeftOfFirstMatch Function
vLine: The string which is to be searched from left-to-right for the appearance of 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 within string vLine. Function returns Null if vFind is Null or cannot be fixed up to a String.

Function returns vLine if vFind is an empty string.

vCompare: Specifies the type of comparison used to determine if strings match. vCompare defaults to Binary comparisons if it is missing or Null or cannot be fixed up to a number.

vIfNotFound: The string which is to be returned if vFind does not appear within vLine. vIfNotFound defaults to vLine (i.e. the string is returned unchanged) if it is missing or Null or cannot be fixed up to a String.

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