Public Function StringsBetweenStringsFast( _ ByRef vSearch As String _ , ByRef vLeft As String _ , ByRef vRight As String _ , ByRef vSeparator As String _ , ByVal vCompare As VbCompareMethod _ ) As String
StringsBetweenStringsFast("Forms![Menu]![Close]", "[", "]", "-", vbBinaryCompare) = "Menu-Close" StringsBetweenStringsFast("Forms![Menu]![Close]", "(", ")", "-", vbBinaryCompare) = "" ' #2. StringsBetweenStringsFast("Larry 'Bud' Melman", "'", "'", "-", vbBinaryCompare) = "Bud"See also:
StringsBetweenStrings FunctionvSearch: The string which is to be searched for non-overlapping appearances of vLeft followed by vRight.
Function returns an empty string if both vLeft or vRight is an empty string.
If vLeft is an empty string and vRight is not, the function returns the sub-string of vSearch between the beginning of the string and the first occurrence of vRight.
If vRight is an empty string and vLeft is not, the function returns the sub-string of vSearch between the first occurrence of vLeft and the end of the string.
Function returns an empty string if vLeft does not appear within vSearch followed by vRight.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.