On Mon, Oct 8, 2012 at 4:11 PM, Prasad, Ramit wrote:
>
>> for ch in text:
>> if '0' <= ch <= '9':
>> doSomething(ch)
>
> I am not sure that will work very well with Unicode numbers. I would
> assume (you know what they say about assuming) that str.isdigit()
> works better with intern
Mark Lawrence wrote:
> On 08/10/2012 17:43, Benjamin Fishbein wrote:
> > I figured out a solution for the question I asked on here.
> > To find the next digit (0-9) in a string, I use:
> > text.find("0" or "1" or "2", etc...)
> > But is there a more elegant way to do this? The way I found uses
On 10/8/2012 12:43 PM, Benjamin Fishbein wrote:
I figured out a solution for the question I asked on here.
To find the next digit (0-9) in a string, I use:
text.find("0" or "1" or "2", etc...)
> But is there a more elegant way to do this? The way I found uses a
lot of typing.
My way is:
i
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
On 08/10/12 17:43, Benjamin Fishbein wrote:
I figured out a solution for the question I asked on here.
To find the next digit (0-9) in a string, I use:
text.find("0" or "1" or "2", etc...)
Are you sure that worked? It doesn't for me on Python 2.7...
>>> s
'a string with 7 words in it'
>>>
On 08/10/2012 17:43, Benjamin Fishbein wrote:
I figured out a solution for the question I asked on here.
To find the next digit (0-9) in a string, I use:
text.find("0" or "1" or "2", etc...)
But is there a more elegant way to do this? The way I found uses a lot of
typing.
___
I figured out a solution for the question I asked on here.
To find the next digit (0-9) in a string, I use:
text.find("0" or "1" or "2", etc...)
But is there a more elegant way to do this? The way I found uses a lot of
typing.
___
Tutor maillist -