On 08/10/12 11:51, Arnej Duranovic wrote:
Alright guys, I appreciate all your help SO much. I know understand, as the
gentleman above said A string is a string is a string doesn't matter
what is in it and they are ordered the same way...BUT this is what was
going through my head. Since letters
Steven D'Aprano wrote:
It is a little-known fact that Unix sys admins, and C programmers, can
only type a fixed number of keys before their brains explode. Sad but
true. Since nobody knows how many keys that will be, but only that it is
fixed at birth, they have a horror of typing four
Is there a way to find the next character that is a digit (0-9) in a string? It
seems that the str.find method can only find one particular character, rather
than any character from among many.
___
Tutor maillist - Tutor@python.org
To unsubscribe or
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 -
On 08/10/12 17:33, Benjamin Fishbein wrote:
Is there a way to find the next character that is a digit (0-9) in a string?
it seems that the str.find method can only find one particular
character,
When looking for patterns rather than literal values you need to use
regular expressions. These
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.
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'
s.find('4'
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
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:
import
On 09/10/12 03:33, Benjamin Fishbein wrote:
Is there a way to find the next character that is a digit (0-9) in a
string? It seems that the str.find method can only find one particular
character, rather than any character from among many.
Correct.
For more complicated searching needs, either
Sander Sweers schreef:
Roel Schroeven schreef op zo 07-10-2012 om 21:19 [+0200]:
Sander Sweers schreef:
Op 7 okt. 2012 04:29 schreef aklei...@sonic.net
mailto:aklei...@sonic.net het volgende:
I'm also not sure but I seem to remember that it is
(SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
On 8 October 2012 03:19, eryksun eryk...@gmail.com wrote:
As a supplement to what's already been stated about string
comparisons, here's a possible solution if you need a more 'natural'
sort order such as '1', '5', '10', '50', '100'.
You can use a regular expression to split the string into a
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 a lot of
On 08/10/12 19:31, Steven D'Aprano wrote:
re.search(r'\d', 'I 8 sandwiches').start()
# returns 2
I knew there was a better way that using index
and group but I couldn't think what it was...
start() so obvious once you see it :-)
--
Alan G
Author of the Learn to Program web site
On Mon, Oct 8, 2012 at 4:11 PM, Prasad, Ramit ramit.pra...@jpmorgan.com 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
On Mon, Oct 08, 2012 at 08:50:14PM +0200, Roel Schroeven wrote:
Sander Sweers schreef:
As far as I know also in Belgium Sunday is officially the first day of
the week. Look at the calendar and check what is the leftmost day. My
guess this is the same as your northern neighbor, Sunday ;-).
Steve,
On Thu, Oct 4, 2012 at 6:28 AM, Steven D'Aprano st...@pearwood.info wrote:
snip
Now, ask me about *raw strings*, and the difference between Unicode
and byte strings :)
How can I resist asking! I am not in chapter 2 of my study text yet,
but looking ahead raw strings seem to be a method
17 matches
Mail list logo