I need to remove some text from a big string with start and end label. For example:
...
// THIS IS START
..
..
// THIS IS END
...
Above text is saved in an variable. And I need to remove all texts start with // THIS IS START
to // THIS IS END
. I know that I can remove them by split the string into lines and parse them line by line. But I am looking for a better solution. Whether I can use regex
to achieve this? The difficult part for me is to use variables for start/end labels.