print(("%q"):format('first line \n second line')
--will print like
first line \
second line
So I'm making this one program where I need the ability to make a new line of text when I want to, however using format:\n thing causes the last part of the first line to get a \ at the end.
That will break my script, thus I need some way to make the new line like above, but it doesn't cause that annoying \ at the end of the previous line. FYI this will eventually be used in a Textbox, the script above still writes it to the text box correctly, the \ will just break the script when I go back to read it.

3 comments
Works fine for me when I do "print('a sentence\nanother sentence')"
Have you tried using %s instead of %q?
Have you tried not using :format in the first place?