[Tutor] finding digit in string

Dave Angel d at davea.name
Mon Oct 8 19:53:22 CEST 2012


On 10/08/2012 12:43 PM, Benjamin Fishbein wrote:
> I figured out a solution for the question I asked on here.

Why then did you start a new thread, instead of responding on the same
one?  You didn't even use the same subject string.

> To find the next digit (0-9) in a string, I use:
> text.find("0" or "1" or "2", etc.......)

That won't work.  "0" or "1"  is just "0"     So you're searching for
the character zero.

> But is there a more elegant way to do this? The way I found uses a lot of typing.
>

See the other thread you started, with subject
    "[Tutor] finding a number with str.find"

-- 

DaveA



More information about the Tutor mailing list