Re: shouldn't 'string'.find('ugh') return 0, not -1 ?
- From: "Andrii V. Mishkovskyi" <mishok13@xxxxxxxxx>
- Date: Wed, 31 Oct 2007 17:22:13 +0300
2007/10/31, jelle <jelleferinga@xxxxxxxxx>:
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)
idiom, which is a bit of a pity I think.
cheers,
-jelle
--
http://mail.python.org/mailman/listinfo/python-list
'foo'.find('f') returns 0
What's your point? :/
--
Wbr, Andrii Mishkovskyi.
He's got a heart of a little child, and he keeps it in a jar on his desk.
.
- 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):
Relevant Pages
|