Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Find and Conditional Expressions solution in Clear category for Between Markers by smidem
def between_markers(text: str, begin: str, end: str) -> str:
# Find the index at the end of begin if it's present.
begin = text.find(begin) + len(begin) if begin in text else 0
# Find the index of end if it's present.
end = text.find(end) if end in text else len(text)
return text[begin:end]
Sept. 25, 2018
Comments: