1

We can certainly do it by

string.chomp+"\r\n"

but I'm wondering is there an elegant way to do it.

sawa
  • 165,429
  • 45
  • 277
  • 381
mko
  • 21,334
  • 49
  • 130
  • 191

1 Answers1

0

Not that I'm aware of.

This prior answer seems to suggest use of gsub (regex replacement)

Normalizing line endings in Ruby

Community
  • 1
  • 1
peakxu
  • 6,667
  • 1
  • 28
  • 27