Hello,
You got 2 out of 3 commands that you need :-), just add COPYSTR([String],[Position],[Length]);. Something like this:
begin
textstring := 'This is line1. this is line 2. this is line 3';
LinePos := StrPos(TextString, '.');
line1 := CopyStr(TextString, 1, LinePos);
TextString := CopyStr(TextString, LinePos + 1);
LinePos := StrPos(TextString, '.');
line2 := CopyStr(TextString, 1, LinePos);
TextString := CopyStr(TextString, LinePos + 1);
line3 := TextString;
Message(Line1 + '\' + Line2 + '\' + Line3);
end;
var
TextString, Line1, Line2, Line3 : Text;
LinePos: Integer;
Note, I have not tested this, and likely I got a position wrong a few places, so it likely needs to be adjusted. Add more MESSAGE to see how the string develops.
Once that works, of course then the next challenge would be to do this as a function, something like this:
WHILE STRPOS(TextString,'.') <> 0 DO
TextString := MyFunction(TextString);
hth