Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75857 > unrolled thread

more simple to split the string?

Started byelearn <elearn2014@gmail.com>
First post2014-08-08 08:23 +0800
Last post2014-08-08 08:23 +0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  more simple to split the string? elearn <elearn2014@gmail.com> - 2014-08-08 08:23 +0800

#75857 — more simple to split the string?

Fromelearn <elearn2014@gmail.com>
Date2014-08-08 08:23 +0800
Subjectmore simple to split the string?
Message-ID<mailman.12730.1407457404.18130.python-list@python.org>
str='(\\HasNoChildren \\Junk) "/" "[Gmail]/&V4NXPpCuTvY-"'
x=str.split(' "')
[i.replace('"','') for i in x]
['(\\HasNoChildren \\Junk)', '/', '[Gmail]/&V4NXPpCuTvY-']

x.strip(" ") will create four parts.

is there more simple to do that ?

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web