Can I use a Java Script function to divide a string into multiple parts?
var string = "This is a test text, again, this is a testing text";
For instance, I can split the string using ,
like this: string.split(',');
resulting in:
var string = ["This is a test text", "again", "this is a testing text"];
Now, I am interested in splitting the string based on specific parameters, so the string array would be:
var string = ["test text", "testing text"]
I am seeking a function that can extract all the sections of the string that start with test
and end with text
.