I have a simple problem that I think I need help with. So, I have a function that accepts a string in this format
"1. Crowe, Velvet (LoC), 2. Hume, Eleanor (Ext), 4. Shigure, Rokurou (DmN), 10. Mayvin, Magilou (MgC)" without the quotation marks.
Basically, a list of person's names with rank number.
What I want is to split them such that I will get the ff result:
[
"1. Crowe, Velvet (LoC)",
"2. Hume, Eleanor (Ext)",
"4. Shigure, Rokurou (DmN)",
"10. Mayvin, Magilou (MgC)"
]
Is there a way to do that? I used split() method but it splits the string every time it sees an occurrence of the comma.
<number>. <text>, <text> (<text>)?"1. Crowe, Velvet (LoC), 2. Hume, Eleanor (Ext), 4. Shigure, Rokurou (DmN), 10. Mayvin, Magilou (MgC)".split("),").map(el => el+")")