read line on Gideros without carriage return

192 Views Asked by At

I tested the following code on LuaEdit and stores a string just like I want it.

local lineVal = myFile:read("*line")

However when I test it in Gideros, it stores a string with the line plus a carriage return, which I don't need. How do I get only the strings on the line without the carriage return?

Please help.

1

There are 1 best solutions below

0
OxCantEven On BEST ANSWER

If the output is giving you a carriage return you're not expecting you could always use gsub to get rid of it.

lineval = string.gsub(lineval,"\r","")