170
rated 0 times
[
171]
[
1]
/ answers: 1 / hits: 28295
/ 13 Years ago, fri, december 2, 2011, 12:00:00
I have a string that I need split into smaller strings with an equal length of 6. I tried using:
'abcdefghijklmnopqrstuvwxyz'.split(/(.{6})/)
But it returns an array with empty strings like so:
[, abcdef, , ghijkl, , mnopqr, , stuvwx, ]
More From » javascript