LastPos

Top  Previous  Next

function LastPos(SearchStr As String, Source As String) As Integer

 

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

 

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

 

Parameters

 

SearchStr ... String expression being searched.
Source ... String expression sought.

 

Example:

Dim s, i

 

= "a number or a text"

= LastPos("a", s)

' returns i = 13

 




Translate document: