Last active
August 29, 2015 14:08
-
-
Save arufian/cf773069d7f9ecd0b33a to your computer and use it in GitHub Desktop.
To make a new line (<br />) on the text every 10 chars
This file contains hidden or 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 makeNewLine = function(texta) { | |
| var retval = texta; | |
| if (texta.length > 10) { | |
| retval = ''; | |
| var iter = texta.length / 10; | |
| for (var i = 0; i < iter; i++) { | |
| retval += texta.substring(i * 10, ((i + 1) * 10)-1); | |
| retval += '<br />'; | |
| } | |
| } | |
| return retval; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment