Search substring in a string and get index of all occurances
sreeram at tachyontech.net
Wed Jun 21 14:27:14 CEST 2006
Maric Michaud wrote:
> Actually it's even more efficient than Lundh's
effbot's solution finds overlapping occurrences, whereas your solution
finds non-overlapping occurrences. So efficiency comparisons are not valid.
indices( 'aaaaa', 'aa' )
your solution gives: 0,2
effbots's solution: 0,1,2,3
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 260 bytes
Desc: OpenPGP digital signature
More information about the Python-list