which one is faster?

Stephen.Wu 54wutong at gmail.com
Fri Jan 29 07:29:53 CET 2010


str.find(targetStr)
str.index(targetStr) with exception
str.count(targetStr)
targetStr in str

which is the fastest way to check whether targetStr is in str?

thanks all



More information about the Python-list mailing list