Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {==============================================================================]
- Explanation: Returns the string after s in str AFTER offset.
- [==============================================================================}
- function AfterEx(s, str: string; offset: Integer): string;
- var
- p, sL, strL: Integer;
- begin
- sL := Length(s);
- strL := Length(str);
- if ((sL < strL) and (offset < strL)) then
- begin
- p := PosEx(s, str, offset);
- if (p > 0) then
- Result := Copy(str, (p + sL), ((1 + strL) - (p + sL)))
- else
- Result := '';
- end else
- Result := '';
- end;
- var
- o: Integer;
- str: string;
- begin
- ClearDebug;
- str := 'Hmmmph, testing AfterEx(), testing AfterEx() WORKS!';
- o := Pos('testing', str);
- WriteLn(AfterEx('testing ', str, (o + 1)));
- end.
Advertisement
Add Comment
Please, Sign In to add comment