which one is faster?
jgardner at jonathangardner.net
Fri Jan 29 23:27:19 CET 2010
On Jan 28, 10:29 pm, "Stephen.Wu" <54wut... at gmail.com> wrote:
> str.index(targetStr) with exception
> 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
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".
More information about the Python-list