Replace Carriage Return and New Line with Blank Space

How come something so simple is seemingly so hard this morning.

How do I replace all carriage returns and new line characters with a
blank space? Should be straight forward no?

Your Friend,


John K.
[email protected]

string_with_returns_and_newlines.gsub(/\r?\n/, " ") work?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs