string.split escaping

Andreas Jung andreas at andreas-jung.com
Thu May 29 02:40:12 EDT 2003


check out the maxsplit parameter of the split() method.

-aj

--On Donnerstag, 29. Mai 2003 16:03 Uhr +1000 Dave Harrison 
<dave at nullcube.com> wrote:

> If I have a string
>
> a = 'dog;cat;big;dog'
>
> How do I escape the last ';' so that when I call
>
> string.split(a, ';')
>
> I get
>
> ['dog', 'cat', 'big;dog']
>
> ??
>
> --
> http://mail.python.org/mailman/listinfo/python-list









More information about the Python-list mailing list