Janilabo

Janilabo | After() [Simba]

Jun 21st, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.39 KB | None | 0 0
  1. function After(s, str: string): string;
  2. var
  3.   p, strL, sL: Integer;
  4. begin
  5.   sL := Length(s);
  6.   strL := Length(str);
  7.   if (sL >= strL) then
  8.     Exit;
  9.   p := Pos(s, str);
  10.   if (p > 0) then
  11.     Result := Copy(str, (p + sL), ((1 + strL) - (p + sL)));
  12. end;
  13.  
  14. var
  15.   str: string;
  16.  
  17. begin
  18.   ClearDebug;
  19.   str := 'What comes after this? After() WORKS!';
  20.   WriteLn(After('this? ', str));
  21. end.
Add Comment
Please, Sign In to add comment