Sub FindWildcard($source As String, $wildcard As String, ByRef $startPos As Integer, ByRef $length As Integer) As Boolean


Searches $source for the first occurrence of $wildcard. $wildcard is a wildcard expression that consists of a start text, an asterisk, and an end text with the following syntax:


StartText*EndText


FindWildcard is case-insensitive. The first character in $source has the position 1. If $wildcard is found, FindWildcard returns TRUE.


Parameters


  • $source ... String expression in which the search is performed.
  • $wildcard ... Wildcard expression to search for (StartText*EndText).
  • $startPos ... Index of the first occurrence.
  • $length ... Length of the found string.


Example:

Dim $s, $iStart, $iLen

$s = "a number or a text"
If FindString($s, "or", $iStart, $iLen) Then
   ' returns iStart = 10, iLen = 2
End If