Playing a little more with strings, I found out that string.find
function provides the position of
the first occurance of the substring in the string.
Is there a way how to find out all substring's position ?
To explain more,
let's suppose
mystring='12341 '
import string
0
But I need to find the possition the other '1' in mystring too.
Is it possible?
Or must I use regex?
Thanks for help
L
function provides the position of
the first occurance of the substring in the string.
Is there a way how to find out all substring's position ?
To explain more,
let's suppose
mystring='12341 '
import string
>>string.find(m ystring ,'1')
But I need to find the possition the other '1' in mystring too.
Is it possible?
Or must I use regex?
Thanks for help
L
Comment