GetFirstWildcardMatch

Top  Previous  Next

Sub GetFirstWildcardMatch($source As String, $wildcard As String) As String

 

Searches in $source for the first occurrence of $wildcard. $wildcard is a Wildcard with a start text, an asterisk and an end text with the syntax:

 

StartText*EndText

 

GetFirstWildcardMatch is case-insensitive. If $wildcard is not found, GetFirstWildcardMatch returns an empty string.

 

Parameters

 

$source ... String expression sought.
$wildcard ... Wildcard expression being searched (StartText*EndText).

 

Example:

Dim $s, $s2

 

$s = "a number or a text"

$s2 = GetFirstWildcardMatch($s, "or*xt") 'returns $s2 = "or a text"