Hi all ✋, is there any way to convert text lines from string to table ?
Announcement
Collapse
No announcement yet.
[important] is there any way to convert text lines from string to table ?
Collapse
X
-
Code:local my_string = [[Hello, you can split up this string to a table and add each line with contents to all_lines. This means that empty lines will be ignored.]]; local all_lines = {}; for line in my_string:gmatch("[^\r\n]+") do all_lines[#all_lines + 1] = line; Dialog.Message("testing", line); end
- Likes 1
-
Originally posted by Imagine Programming View PostCode:local my_string = [[Hello, you can split up this string to a table and add each line with contents to all_lines. This means that empty lines will be ignored.]]; local all_lines = {}; for line in my_string:gmatch("[^\r\n]+") do all_lines[#all_lines + 1] = line; Dialog.Message("testing", line); end
Comment
Comment