Can someone help with below ,
I have a string with
var str = "func(1,2) and func(3,4) and (func(5,6) and func(7,8))";
How we can achieve below outputs for above string?
[func(1,2), and, func(3,4), and , (func(5,6) and func(7,8))]
[func(1,2), func(3,4), func(5,6), func(7,8)]
Is that what you are looking for ?
var str = "func(1,2) and func(3,4) and (func(5,6) and func(7,8))";
var result = str.replaceAll("and ", "").split(" ")
console.log(result)