InStr

Top  Previous  Next

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

 

' -or-

 

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

 

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

 

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

 

Parameters

 

$searchStr ... String expression being searched.
$source ... String expression sought.

 

Example:

Dim $s, $i

   

$s = "This is a text"

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