Sub FindString($source As String, $findStr As String, ByRef $startPos As Integer, ByRef $length As Integer) As Boolean


Searches $source for the first occurrence of $findStr.


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


Parameters


  • $source ... String expression in which the search is performed.
  • $findStr ... String expression to search for.
  • $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