javascript - How to separate String of times into parts (array)? -
i have string
"09:2510:3012:0514:4517:2520:0521:0522:4501:30"
i want can this:
i try use , still can figure out.
function() { for(var = 0; < movietime.length; i++){ console.log(movietime[0]); // don't know how complete. };
please show me tips , appreciated.
thanks in advance.
with little regex, can separate them. assuming have standard format of string.
var str = "09:2510:3012:0514:4517:2520:0521:0522:4501:30"; var times = str.match(/.{1,5}/g) console.log(times);
Comments
Post a Comment