I\'m trying to see if a string exists in another string with out using Python\'s predefined functions such as find and index..
Right now what my function takes 2 strings
probably the best way to do this is to keep calling the find function (this is fastest too)
def multifind(string, value, start = 0, stop = None):
values = []
while True:
found = string.find(value, start, stop)
if found == -1:
break
values.append(found)
start = found + 1
return values
print multifind('hello abc abc', 'abc')
Output:
[6, 10]