Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Between Markers by rodka81
def between_markers(text: str, begin: str, end: str) -> str:
"""
returns substring between two given markers
"""
ibegin = text.find(begin)
iend = text.find(end)
if ibegin == -1:
ibegin = 0
else:
ibegin += len(begin)
if iend == -1:
return text[ibegin:]
return text[ibegin:iend]
Aug. 29, 2018
Comments: