Sfairadora

  • Reference Guide

find_str_back

find_str_back(str, substr)
find_str_back(str, pos, substr)
Finds the first occurrence of the string substr in the string str from the end and returns its index. If the parameter pos is specified, the string is searched from that index.
The function returns the index of the first occurrence of the string being searched. The index of the first character in the string is 0. If pos is negative, its value is considered 0. If the string is not found, an error is returned. This condition can be handled, for instance, using the try statement. If pos is beyond the end of the string str or is not specified, the whole string is searched.
Note: this function serves to search a character string. To serach binary data, use the analogical function find_bytes_back.

Parameters

str
The string in which to search. Type String or Text.
substr
The string to be searched for. Type String or Text.
pos
Position where begin searching. Type Int. The value 0 denotes the beginning of the string.

Return Value

The function returns the index of the first occurrence found (the Int type) or an error.

See Also