How do you print() a newline?

How do you print() a newline? Google search says put \n inside the string you’re printing to get a carriage return, but that just prints “\n”. Forum search finds nothing for “newline” or “carriage return.”

I may be mistaken, but AFAIK, the log panel is not designed to handle new line characters (and other things like \t, etc…) like you’re expecting in this case. It will always just print the text representation.

^ that’s for characters you explicty embed in strings, as you allude to above.
However, (I remember now) puts and print insert a new line character at the end of your string for you which is interpreted as such, rather than just spat out as text - so you can achieve something similar by using multiple puts statements:
The below example prints a blank line in the log messages and then a new line with the word “test” on it.

puts # just a new line by itself
puts "test" # "test" with a new line inserted at the end

Which looks like this:

1 Like

Thanks. Why didn’t I think of that.