lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

rahul sharma wrote:
> I am facing problems in following 80 columns format in lua. I tried to
> add "\\n" to break the line but its not working.
> Usually we add \ and then \n to break the line into two parts, but in
> Lua, this standard doesn't work by default. Can you help me in getting
> some way using which I can do this?

If you are using Lua 5.2 you can use the "\z" escape that removes the
following line break and all the initial spaces. That would be the most
efficient way, but it works only in Lua 5.2. In Lua 5.1 I would
concatenate the strings.

x = "first words \z
     followed by second line"

-> "first words followed by second line"