\n is an escape sequence indicating a new line. Backslashes are the beginning of escape sequences to output a backslash and then write \\ . So you want \\n . Other useful escape sequences include a quote: use \" to put a quote on a line instead of the end of a line.
source share