Skip to content

Instantly share code, notes, and snippets.

@bishopandco
Created March 26, 2010 07:01
Show Gist options
  • Save bishopandco/344610 to your computer and use it in GitHub Desktop.
Save bishopandco/344610 to your computer and use it in GitHub Desktop.
def snippet(thought, wordcount)
thought.split[0..(wordcount-1)].join(" ") +(thought.split.size > wordcount ? "..." : "")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment