I have a list of index 'chunks' that I need to remove from a string. An example:
list_to_remove = [(0, 4), (10, 14)]
test_text = "This is a test sentence"
The removal should be characters from index 0 to 4, and characters from index 10 to 14.
After removal the result should be:
test_text_clean = "is a sentence"
I have thought about looping through the chunks in the list and slicing the string, however removing something from the string would change the position of the remaining characters, meaning my indexes would no longer be correct for the remaining removals.