Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Between Markers by itheklon
def between_markers(text: str, begin: str, end: str) -> str:
s1 = text[text.find(begin)+len(begin):] if text.find(begin) != -1 else text
s2 = s1[:s1.find(end)] if s1.find(end) != -1 else s1
if text.find(begin) != -1 and text.find(end) != -1 and text.find(begin) > text.find(end):
return ''
else:
return s2
Oct. 10, 2018
Comments: