Unnamed
public text v1 · immutabledef findsubstr(text, substr):
"""findsubstr(text, substr) - returns an iterator of positions of substr within text"""
position = text.find(substr)
while position != -1:
yield position
position = text.find(substr, position+1)