Split string into array


/ Published in: JavaScript
Save to your folder(s)

I needed to break down a long string today and insert line breaks so I wrote this little function. You can use it to split a long string into chunks of a defined length and get them as an array or join them by a defined character (e.g. <br />). Have fun.

URL: http://www.chlab.ch/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.