Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function LastPos(s, str: string): Integer;
- var
- l, p: Integer;
- begin
- l := Length(str);
- if (Length(s) > l) then
- Exit;
- repeat
- p := PosEx(s, str, (p + 1));
- if (p > 0) then
- Result := p;
- until (p <= 0);
- end;
- begin
- ClearDebug;
- WriteLn(LastPos('.', 'LastPos() test. The DOT is the result position. <= Over there'));
- end.
Advertisement
Add Comment
Please, Sign In to add comment