Let's say I need to split the string a.b.c.d#.e.f.g.h#.i.j.k.l with separator as # and then ".".
str = a.b.c.d#.e.f.g.h#.i.j.k.l
res = str.split("#")
res[0] will store a.b.c.d when I use split for the 1st time .
I need to split this again and save the data.
can anyone help ?
I think the simplest way to do it is using a regex:
var str = "a.b.c.d#.e.f.g.h#.i.j.k.l";
var res = str.split(/[.#]/);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With