Name

.find()

Examples
pet = 'sea snail'
print(pet.find('a'))       # Prints the index of the 'a' in 'pet': 2.
print(pet.find('a', 3, 7)) # Prints the index of the second 'a' in 
                             # 'pet': 6.

print(pet.find("snail"))   # Prints 4.

print(pet.find("rock"))    # Prints -1.
Description
Syntax
a.find(sub)
a.find(sub,start,end)
Parameters
sub
start
end
Related string
String Formatting
.find()
.strip()
.join()
.replace()
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License