Q:

(Delphi) How to read a string variable and split it into multiple lines and put into a listbox

I have a string containing the following multi-line string value that I read from my database:
01/01/2000, 8:00
02/07/2001, 8:00
09/12/2002, 23:00

How can I put each of those lines into a listbox on its own line.

A:

If you have a list box at hand, and the database hands you a string with line breaks embedded, then you can simply do this.
ListBox.Items.Text := QueryString;

When you assign to the Text property of Items, the string will be parsed by splitting on line breaks. Each line is added to the list box as a separate item.
If your string is using a different delimiter, then you can use DelimitedText and Delimiter instead.

