howto split string with both comma and semicolon delimiters
google at mrabarnett.plus.com
Fri Jun 13 03:10:49 CEST 2008
On Jun 12, 8:06 pm, bvdp <b... at mellowood.ca> wrote:
> dmitrey wrote:
> > hi all,
> > howto split string with both comma and semicolon delimiters?
> > i.e. (for example) get ['a','b','c'] from string "a,b;c"
> > I have tried s.split(',;') but it don't work
> > Thx, D.
> s = s.replace(";", ",")
> s = s.split(",")
I've wondered in the past whether there would be sufficient need for
things like s.split((',', ';')) and s.partition((',', ';')).
More information about the Python-list