You can check if nil value is equal:
if emptyVar == nil then -- Some code end
Since nil is interpreted as false, you can also write the following:
if not emptyVar then -- Some code end
(i.e. if you do not want to check boolean values;))
Regarding linebreak: you can use the string.match function to do this:
local var1, var2 = "some string", "some\nstring with linebreaks" if string.match(var1, "\n") then print("var1 has linebreaks!") end if string.match(var2, "\n") then print("var2 has linebreaks!") end
source share