Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
A string slicing operation, with the help from trinocular operator (三元运算符) solution in Clear category for Between Markers by ArchTauruS
"""A string slicing operation, with the help from trinocular operator (三元运算符)
"""
def between_markers(text, begin, end):
a = text.find(begin) + len(begin) if begin in text else 0
b = text.find(end) if end in text else len(text)
return text[a:b]
Nov. 8, 2018
Comments: