duhaime
duhaime

Reputation: 27611

Prevent Rails console from removing consecutive linebreaks

I'd like to prevent the Rails console from removing consecutive linebreaks:

CoolApp (PRODUCTION) > a = '
CoolApp (PRODUCTION) " hi
CoolApp (PRODUCTION) " 
CoolApp (PRODUCTION) " 
CoolApp (PRODUCTION) " hi'
=> "\nhi\nhi"

Does anyone know how I can do it? The string above should be "\nhi\n\n\nhi"

Upvotes: 0

Views: 36

Answers (1)

duhaime
duhaime

Reputation: 27611

Seems like entering a single space on each new line will preserve that line's linebreak :)

Upvotes: 0

Related Questions