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