On Jan 28, 10:29 pm, "Stephen.Wu" <54wut...@gmail.com> wrote: > 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? >
The fastest way of all is to forget about this and finish the rest of your program. Developer time is much, much more valuable than processor time. When you are all done, and have solved all the other problems in the world, you can come back and pontificate on how many nanoseconds you can save by using "find" or "in". -- http://mail.python.org/mailman/listinfo/python-list