Hi all,
I get text from a text file into my program but the \n new line symbol in these texts is somehow not recognized. I’ve tried to convert the text from the textfile after reading, but the \n symbol is never recognized and translated in a new line. It is just printed as ‘\n’, where a new line should come.
However, it is recognized when I define a string in the program itself containing the \n sequence. But I need the ones imported to be recognized. How can I accomplish this?
This is in my code for reading:
local lieds = {}
for line in file:lines() do
lieds[i] = line
i=i+1
end
In this code the \n is not recognized but printed in my program as \n instead of a new line.
But when I define a string like this and print the string, the \n code IS translated into a new line…:
local lieds = {}
lieds[1] = “bla bla \n bla bla”
lieds[2] = “etc \n etc”
I hope you can help!
Jules