Sub InStr($source As String, $searchStr As String) As Integer

' -or-

Sub Pos($searchStr As String, $source As String) As Integer


Returns an integer that specifies the start position of the first occurrence of one string within another string.


InStr is case-sensitive. The first character in $source has the position 1. If $searchStr is not found, InStr returns 0.


Parameters


  • $searchStr ... String expression to search for.
  • $source ... String expression in which the search is performed.


Example:

Dim $s, $i

$s = "This is a text"
$i = InStr($s, "is") 'returns $i = 6