有时我会删除或替换一个长字符串的子字符串。因此,我将确定一个开始模式和一个结束模式,这将确定子字符串的起点和终点:
long_string = "lorem ipsum..white chevy..blah,blah...lot of text..beer bottle....and so to the end"
removed_substr_start = "white chevy"
removed_substr_end = "beer bott"
# this is pseudo method down
STRresult = long_string.replace( [from]removed_substr_start [to]removed_substr_end, "")