Skip to content

Instantly share code, notes, and snippets.

@cmhobbs
Created November 2, 2012 20:54
Show Gist options
  • Save cmhobbs/4004239 to your computer and use it in GitHub Desktop.
Save cmhobbs/4004239 to your computer and use it in GitHub Desktop.
s = "spam eggs ham"
s.split(" ").last(2).join(" ")
# => "eggs ham"
s.gsub(/^\S+\s*/, "")
# => "eggs ham"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment