Does anyone know how can I cut a string and then assign into an array with javascript? Example:
var string = "15;24;67;34;56";
I hope tp cut this string into below format and assign into the array:
a[0] = 15 a[1] = 24 a[2] = 67 a[3] = 34 a[3] = 56
string.split(";")
In this example, you'll end up with an extra array item at the end, though, so you'll want to handle that separately.