+ 3
Manav Roy The second parameter in s.substring is the number of characters, not the end index. try this: s=s.substr(i1+1,i2-i1-1);
18th Jul 2022, 1:46 PM
Bob_Li
Bob_Li - avatar
+ 4
The 2nd argument of the substr method is not the end index but the span (how many characters from the starting point) s=s.substr(i1+1,i2-i1-1);
18th Jul 2022, 1:49 PM
Lisa
Lisa - avatar
+ 1
Manav Roy You probably would have to mess around with regex sooner or later. It is a pain to get right. https://code.sololearn.com/cGnWsbs8BvB8/?ref=app
19th Jul 2022, 7:28 AM
Bob_Li
Bob_Li - avatar