- Introduction
- License
- History
- Compilation & Hosting
- Configuration File
- Modules:
- FAQ
- Links
- Credits
|
Declaration:
-
function substr_rpos(const str, sub: string): longint;
Arguments:
-
str |
Source string for search |
sub |
Substring to search for |
Description:
-
Returns position of last occurrence of needle sub in haystack str.
Returns:
-
1-based substring position on success or 0 if substring was not found.
Usage:
-
s := 'Does this haystack contain any needles? We need them!';
i := substr_rpos(s, 'need');
writeln('Needle position: ', i);
See also:
-
substr_pos, substr_irpos, substr_exists, substr_count.
|