Example:
string = "aabcdefgg"
string.inbetween("a", "g") # abcdefg
I want to avoid regex, if possible.
Edit:
I want to get the characters in between the first occurrence of both arguments.
>Solution :
What about a simple find?
string = "aabcdefgg"
start = string.find("a") + 1
end = string.find("g", start) + 1
print(string[start:end]) # abcdefg