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.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.
When you assign to the
Textproperty ofItems, 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
DelimitedTextandDelimiterinstead.