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

String Between Strings Fast Function
String Searches Class

Public Function StringBetweenStringsFast( _
      ByRef vSearch As String _
    , ByRef vLeft As String _
    , ByRef vRight As String _
    , ByRef vCompare As VbCompareMethod _
    ) As String

Return the string between the first occurrences of vRight and vLeft.
Faster version of the StringBetweenStrings function which uses restrictive argument types to avoid argument fix-up code.

Examples:
    StringBetweenStringsFast("Forms![Menu]![Close]", "[", "]", vbBinaryCompare) = "Menu"
    StringBetweenStringsFast("Forms![Menu]![Close]", "(", ")", vbBinaryCompare) = "" ' #2.
    StringBetweenStringsFast("Larry 'Bud' Melman", "'", "'", vbBinaryCompare) = "Bud"
See also:
    StringBetweenStrings Function
vSearch: The string which is to be searched for the appearance of vLeft followed by vRight.
vLeft: The string which delimits the left side of the string to be returned.
vRight: The string which delimits the right side of the string to be returned.
vCompare: Specifies the type of comparison used to determine if strings match.

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.