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

String Between Strings Function
String Searches Class

Public Function StringBetweenStrings( _
      ByVal vSearch As Variant _
    , ByVal vLeft As Variant _
    , ByVal vRight As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Variant

Return the string between the first occurrences of vRight and vLeft.

Examples:
    StringBetweenStrings("Forms![Menu]![Close]", "[", "]") = "Menu"
    StringBetweenStrings("Forms![Menu]![Close]", "(", ")") = "" ' #2.
    StringBetweenStrings("Larry 'Bud' Melman", "'", "'") = "Bud"
See also:
    StringBetweenStringsFast Function
    StringsBetweenStrings Function
vSearch: The string which is to be searched for the appearance of vLeft followed by vRight. Function returns Null if vSearch is Null or cannot be fixed up to a String.

vLeft: The string which delimits the left side of the string to be returned. Function returns Null if vLeft is Null or cannot be fixed up to a String.

vRight: The string which delimits the right side of the string to be returned. Function returns Null if vRight is Null or cannot be fixed up to a 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.

Function returns an empty string if either vLeft or vRight is an empty string.

Function returns an empty string if vLeft does not appear within vSearch followed by vRight as in example #2.

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