Skip to content

Instantly share code, notes, and snippets.

@sarahhodne
Created August 6, 2010 23:25
Show Gist options
  • Save sarahhodne/512193 to your computer and use it in GitHub Desktop.
Save sarahhodne/512193 to your computer and use it in GitHub Desktop.
class String
def has_newlines?
self.include?("\n")
end
end
"some oneline string".has_newlines? # => false
"some multiline\nstring".has_newlines? # => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment