Skip to content

Instantly share code, notes, and snippets.

@mluton
Created August 15, 2012 21:52
Show Gist options
  • Save mluton/3364025 to your computer and use it in GitHub Desktop.
Save mluton/3364025 to your computer and use it in GitHub Desktop.
Remove EOL characters from a string in Ruby
# This will work no matter where the characters appear in the string.
gsub(/\r\n?/, '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment