lastpos PowerHome formula function
Description
Finds the last position of a target string in a source string.
Syntax
lastpos ( string1, string2 {, searchlength } )
Argument Description
string1 The string in which you want to find string2
string2 The string you want to find in string1
searchlength (optional) A long that limits the search to the leftmost searchlength characters of the source string string1. The default is the entire string
Return value
Long. Returns a long whose value is the starting position of the last occurrence of string2 in string1 within the characters specified in searchlength. If string2 is not found in string1 or if searchlength is 0, LastPos returns 0. If any argument's value is NULL, LastPos returns NULL.
Usage
The LastPos function is case sensitive. The entire target string must be found in the source string.