I have the following string:
"Vortioxetine[1], Imipramine[2], Citalopramasdddd[2], Vortioxetine[1], Imipramine[2], Citalopram[2]"
and I want to split it into an array with every other comma, so the result would be an array of
[0]Vortioxetine[1], Imipramine[2],
[1]Citalopramasdddd[2], Vortioxetine[1],
[2]Imipramine[2], Citalopram[2]
I currently have this code to split it by a single comma:
const pharma = "Vortioxetine[1], Imipramine[2], Citalopramasdddd[2], Vortioxetine[1], Imipramine[2], Citalopram[2]"
const split = pharma.split(',');
for(const index in split){
drawText(page, split[index], {
...tableTextBodyCol3 ,
x: col6X + 2,
});
}
You can ignore the drawText area as that is program specific, but I would like it to draw 2 words on the page that I have where as right now it is just doing 1, let me know if other info is needed.