Navigation
Synopsis Find all occurrences of a string in another string.
Function list[int] findAll(str subject, str find)
Usage import String;
Description Find all occurrences of string find in string subject. The result is a (possible empty) list of positions where find matches.

See also findFirst and findLast.
Examples
rascal>import String;
ok
rascal>findAll("abracadabra", "a");
list[int]: [0,3,5,7,10]
rascal>findAll("abracadabra", "bra");
list[int]: [1,8]
rascal>findAll("abracadabra", "e");
list[int]: []
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.