Rinstr |
Strings | |
Aptilis 1 |
Rinstr([FromWhere,] String1, String2)
Rinstr works like
Instr except that it looks for string2 in string1
starting from the right.
It returns the position of the searched string if it has been found,
otherwise it returns zero.
When Aptilis is dealing with strings, indexes start at 1. For example,
the index of "tw" in "two" is 1, and the index
of "wo" in "two" is 2.
The optional index specified before the two strings allows you
to search from a given position. That is especially useful when you try
to find several occurences of the same substring in one given string.
Return Value:
The index of the substring being searched or 0 (zero) if it has not
been found. Note that the index is relative to the begining of the
string (as for Instr) not the end.
Example:
e = "can of beans of Canada" $ print(rinstr(e$, "of"))Result:
14.0000 |
Notes:
Even if a start position is given, the index returned
will be a count from the first character.
See also:
Instr