like a "for loop" for a string

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Sun Aug 17 21:07:45 CEST 2008


Wojtek Walczak:
> >>> somestr = "string1 string2 string3"
> >>> for i in somestr.split():
>
> ...    print i
> ...
> string1
> string2
> string3

I'm waiting for a str.xsplit still :-)
If I write and submit a C implementation of xsplit how many chances do
I have to see it included into Python? :-)

Bye,
bearophile



More information about the Python-list mailing list