Str.find returns the lowest index in string where substring sub(which we want to find) is found and returns -1 if value is not present.
Syntax of str.find:
find(sub, start, end) Sub=Object we want to find out. start=Starting index of string end=Ending index of string. a='1234' is a string. a.find('4',0,4) Output:=3 Output 3 is the index of the object 4.as we can see eleme
nt 4 is present at 3 position.
[…] 8.Str.Find: It returns index of the substring which is to be find. […]
[…] syntax of both str.find & rfind are same the main difference in that str.find returns lowest index position and whereas str.rfind returns highest index […]