I have a string in Ruby, s (say) which might have any of the standard line endings (\\n, \\r\\n, \\r). I want to convert
s
\\n
\\r\\n
\\r
I think the cleanest solution would be to use a regular expression:
s.gsub! /\r\n?/, "\n"