[O] Use doctests

This commit is contained in:
Hykilpikonna
2022-08-13 17:51:19 -04:00
committed by GitHub
parent e29d0f2c00
commit 8d68f22eaa
+2 -5
View File
@@ -35,14 +35,11 @@ def substr_between(s: str, start: str | None = None, end: str | None = None):
""" """
Get substring between two strings Get substring between two strings
:param s: E.g. "Foo abc Bar" >>> substr_between('abc { meow } def', '{', '}')
:param start: E.g. "Foo" ' meow '
:param end: E.g. "Bar"
:return: E.g. " abc "
""" """
if start: if start:
s = s[s.index(start) + len(start):] s = s[s.index(start) + len(start):]
if end: if end:
s = s[:s.index(end)] s = s[:s.index(end)]
return s return s