I need to split a string by a delimiter so that it becomes 2 arrays.
Here is an example of string "55,56,*,51,52".
I want to end up with [["55","56],["51","52"]]
I have trie with split() in javascript to no avail-
I believe I need a regex solution, which I do not know how to do.
if the string to process looks like this ",*,51,52" it should return
[[],["51,"52"]]
if it looks like "51,*," it should return [["51"],[]]
and ",*," should return [[],[]] -
Is this possible?
Thanks.