Created
December 13, 2016 19:33
-
-
Save jsstoni/0d3db9c0a84710e87c1fe84080adf9e4 to your computer and use it in GitHub Desktop.
Acortar texto de un párrafo por lineas javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stringCut = function (str, limit) { | |
//str = string texto para acortar | |
//limit = limite de lineas para mostrar | |
limit = limit || 10; | |
var separe = str.split(/\n/g); | |
return separe.slice(0, limit).join(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment