On Sun, 27 Feb 2005 18:12:17 -0700, rumours say that Steven Bethard
<[EMAIL PROTECTED]> might have written:
[snip Nick Coghlan's list comprehension]
[STeVe]
>On the other hand, filter doesn't do the same thing:
>
>py> s = u'The Beatles - help - 03 - Ticket to ride'
>py> filter(str.isalpha, s)
>Tr
On Sun, 27 Feb 2005 18:12:17 -0700, rumours say that Steven Bethard
<[EMAIL PROTECTED]> might have written:
[snip Nick Coghlan's list comprehension]
[STeVe]
>On the other hand, filter doesn't do the same thing:
>
>py> s = u'The Beatles - help - 03 - Ticket to ride'
>py> filter(str.isalpha, s)
>Tr
Nick Coghlan wrote:
Jimmy Retzlaff wrote:
The approach you are considering may be easier than you think:
filter(str.isalpha, 'The Beatles - help - 03 - Ticket to ride')
'TheBeatleshelpTickettoride'
Hmm, I think this is a case where filter is significantly clearer than
the equivalent list comprehen
Jimmy Retzlaff wrote:
Anthonyberet wrote:
Is there a string mething to return only the alpha characters of a
string?
eg 'The Beatles - help - 03 - Ticket to ride', would be
'TheBeatlesTickettoride'
If not then how best to approach this?
I have some complicated plan to cut the string into individual
Jimmy Retzlaff wrote:
The approach you are considering may be easier than you think:
filter(str.isalpha, 'The Beatles - help - 03 - Ticket to ride')
'TheBeatleshelpTickettoride'
Hmm, I think this is a case where filter is significantly clearer than the
equivalent list comprehension:
Py> "".join(
"anthonyberet" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a string mething to return only the alpha characters of a
> string?
> eg 'The Beatles - help - 03 - Ticket to ride', would be
> 'TheBeatlesTickettoride'
I believe you can do this with string.translate (string
Anthonyberet wrote:
> Is there a string mething to return only the alpha characters of a
string?
> eg 'The Beatles - help - 03 - Ticket to ride', would be
> 'TheBeatlesTickettoride'
>
> If not then how best to approach this?
> I have some complicated plan to cut the string into individual
> charac
anthonyberet wrote:
Is there a string mething to return only the alpha characters of a string?
eg 'The Beatles - help - 03 - Ticket to ride', would be
'TheBeatlesTickettoride'
If not then how best to approach this?
I have some complicated plan to cut the string into individual
characters and the
anthonyberet wrote:
Is there a string mething [method] to return only the alpha characters of a string?
eg 'The Beatles - help - 03 - Ticket to ride', would be
'TheBeatlesTickettoride'
erm, no it wouldn't, it would be 'TheBeatleshelpTickettoride', but you
get me, I am sure.
If not then how bes
Is there a string mething to return only the alpha characters of a string?
eg 'The Beatles - help - 03 - Ticket to ride', would be
'TheBeatlesTickettoride'
If not then how best to approach this?
I have some complicated plan to cut the string into individual
characters and then concatenate a new
10 matches
Mail list logo