I'm trying to parse a delimited string using the javascript split function. I'm using a double character delimiter. So for e.g. if the string contains employee related data with the following fields:
Emp Id (mandatory)
Name (mandatory)
Age (optional)
Mobile No (optional)
and the delimiter used is |*
(i.e. pipe followed by star)
I may have data like this
5322|*Mike|*21|*077665543
5323|*Jen|*|*077665543
5324|*Raj|*25|*
5325|*Alan|*|*
How do I extract null values into the array returned by split?
If I use Record.split(/\|\*/)
It seems to ignore the null values. Do I need to use other functions like regex exec + substring to do this? The split function seems to be quite convenient except for this issue.