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


Groups > comp.lang.python > #75857

more simple to split the string?

Date 2014-08-08 08:23 +0800
From elearn <elearn2014@gmail.com>
Subject more simple to split the string?
Newsgroups comp.lang.python
Message-ID <mailman.12730.1407457404.18130.python-list@python.org> (permalink)

Show all headers | View raw


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 ?

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web