Adding a "\n" in front of a line

assuming I have a field "field1" with value "Hello world"

How can I make the value become "\nHello world"

When I gsub it will always become "\n"HelloWorld"

You can use the unicode escaped character.

"Hello World".gsub("Hello", "\u000aHello")
=> "\nHello World"

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.