![]() |
|
Navigation |
Synopsis Find the last occurrence of a string in another string.
Function
int findLast(str subject, str find)
Usage
import String;
Description Find the last occurrence of string
find in string subject .
The result is either a position in subject or -1 when find is not found.
Also see findAll and findFirst.
Examples
rascal>import String; ok rascal>findLast("abracadabra", "a"); int: 10 rascal>findLast("abracadabra", "bra"); int: 8 rascal>findLast("abracadabra", "e"); int: -1 ![]() |