# Single string with CR/LF throughout the sting
sentence = "the quick
brown fox
jumped over
the lazy
dog"
lines.gsub(/
?/, " ")
=> "the quick brown fox jumped over the lazy dog"
# Array of strings where the CR/LF or other whitespace is at beginging or end
lines = [" hello ", " goodbye
"]
lines.map(&:strip)
=> ["hello", "goodbye"]