Skip to content
Permalink
Browse files
Update README.md
  • Loading branch information
Geek-Fish committed Jul 6, 2016
1 parent 38242d9 commit acf08aad94ec62fc7c1a2675ae8967fdf02bf1b7
Showing with 11 additions and 1 deletion.
  1. +11 −1 README.md
@@ -1,2 +1,12 @@
# Truncate_at_Wordbreak-JS
# Truncate at Wordbreak - Javascript
Truncates a String at the last word break, with the option to append text to the final String - JavaScript

Variables:

str - The original String you want truncated
len - The max length the final, truncated string can be (this takes into account the appended text)
append - Any optional text you would like to append after you truncate str.

Notes:

If text cannot be truncated (the len isn't long enough to reach the first space (with or without your appended text), the function will return the original string.

0 comments on commit acf08aa

Please sign in to comment.