Skip to content

Instantly share code, notes, and snippets.

@madrobby
Created September 29, 2014 18:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madrobby/b428cc58afff0a89c007 to your computer and use it in GitHub Desktop.
Save madrobby/b428cc58afff0a89c007 to your computer and use it in GitHub Desktop.
def self.carriage_returns_to_newlines!(file_contents)
(file_contents.gsub!(/\r\n/,"\n")||file_contents).gsub!(/\r/, "\n") || file_contents
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment