find() a larger string within a smaller string
Mensanator
mensanator at aol.com
Fri Nov 14 14:33:19 EST 2008
More information about the Python-list mailing list
Fri Nov 14 14:33:19 EST 2008
- Previous message (by thread): find() a larger string within a smaller string
- Next message (by thread): find() a larger string within a smaller string
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Nov 14, 1:20 pm, korean_dave <davidrey... at gmail.com> wrote: > 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? Try this: >>> stringa = 'hi' >>> stringb = 'hiyoo' >>> stringa.find(stringb) -1
- Previous message (by thread): find() a larger string within a smaller string
- Next message (by thread): find() a larger string within a smaller string
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list