Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- From: "Simon Brunning" <simon@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Oct 2007 14:22:45 +0000
On 10/31/07, jelle <jelleferinga@xxxxxxxxx> wrote:
the subject pretty much says it all.
if I check a string for for a substring, and this substring isn't found,
should't the .find method return 0 rather than -1?
this breaks the
if check.find('something'):
do(somethingElse)
print 'ughughugh'.find('ugh')
;-)
--
Cheers,
Simon B.
simon@xxxxxxxxxxxxxxxxxx
http://www.brunningonline.net/simon/blog/
GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues
.
- Prev by Date: Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- Next by Date: Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- Previous by thread: Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- Next by thread: Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- Index(es):