I have a multi-line string and I want to remove some lines from it. The TMemo component contains the necessary code to do this.
MyMemo:=TMemo.Create(nil);
try
MyMemo.Text:=MyString;
MyMemo.Lines.Delete(x); // lines I want to delete
MyMemo.Lines.Delete(y);
MyString:=MyMemo.Text;
finally
MyMemo.Free;
end;
But it seems wrong to use a visual component to do basic conversions. Is there a different, but equally simple, way to do this? Thanks