Is there a built-in method in Ruby to convert LF to CRLF in a string and vice versa?
-
12-12-2019 - |
Question
We can certainly do it by
string.chomp+"\r\n"
but I'm wondering is there an elegant way to do it.
Solution
Not that I'm aware of.
This prior answer seems to suggest use of gsub (regex replacement)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow