find() a larger string within a smaller string

korean_dave davidreynon at gmail.com
Fri Nov 14 14:20:33 EST 2008


stringa = "hi"
stringb = "hiyoooo"

I'd like it to return -1 when I do:

returnVal = stringa.find(stringb);

Instead, it treats stringa as "hi" and stringb as "hi".

How do I solve this?



More information about the Python-list mailing list