find the index of a substring : Index « String « Python Tutorial






searchStr =  "Red Blue Violet Green Blue Yellow Black"

print searchStr.index("Blue")








5.11.Index
5.11.1.String literals and other sequence literals may be indexed directly, without using a variable to refer to them
5.11.2.find the index of a substring
5.11.3.index with offset
5.11.4.using None as an index has the same effect as a missing index