Turning a text string of week numbers into array of values with jquery
I've been battling with this for a while:
I've got a mysql database of events happening on various weeks. For each event there is a field with the week numbers tha开发者_运维百科t it is occurring as a text string.
e.g. W01-W04, W06, W08, W10
How can i convert that that to an array of values with jquery?
e.g. W01, W02, W03, W04 ect..
And then how would i replace that row with a row for each week value.
Thanks in advanced.
Just use the .split()
method on your JavaScript string:
string.split(',');
精彩评论