The Lastpos function returns the offset of the last occurrence of a target string within another string.
If the target string is not found, 0 is returned.
result = Lastpos( needle, haystack [, offset ] ) |
Examples:
say Lastpos( 'abra', 'abracadabra' ) -- shows: 8 say Lastpos( 'abra', 'abracadabra', 7 ) -- shows: 1 say Lastpos( 'adra', 'abracadabra' ) -- shows: 0 |