Janilabo Posted May 22, 2012 Share Posted May 22, 2012 Returns the text that is after S in STR. Example included. After [scar]function After(s, str: string): string; var p, strL, sL: Integer; begin sL := Length(s); strL := Length(str); if (sL >= strL) then Exit; p := Pos(s, str); if (p > 0) then Result := Copy(str, (p + sL), ((1 + strL) - (p + sL))); end; var str: string; begin ClearDebug; str := 'What comes after this? After() WORKS!'; WriteLn(After('this? ', str)); end.[/scar] Quote Link to comment Share on other sites More sharing options...