Jump to content
Janilabo

After

Recommended Posts

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]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...