Skip to content

Instantly share code, notes, and snippets.

@tomasfejfar
Created November 10, 2012 13:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomasfejfar/4051035 to your computer and use it in GitHub Desktop.
Save tomasfejfar/4051035 to your computer and use it in GitHub Desktop.
Truncating text, keeping full sentences
text = "Were you born 1. 3. 1987 in Prague? Štěpán Jr. lives there for 3 years now! "
expectedResult = "Were you born 1. 3. 1987 in Prague?"
trimText(input = text, characterLimit = 50) == expectedResult
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment