I'm not aware of a single function that does this. I think the easiest way would be to use Pos
and then Copy
:
answer := Copy(str, Pos('|', str) + 1, Length(str));
Start character is at Pos('|', str) + 1
, amount of characters to copy is actually Length(str)-Pos('|', str)
, but passing a greater value to Copy
also works.
Note: this will return the whole contents of str
if there is no '|'
. Check for Pos('|', str)
being non-zero if you need different behavior.