which one is faster?

Stephen.Wu 54wutong at gmail.com
Fri Jan 29 01:29:53 EST 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