String splitting by spaces question

Alemu Tadesse atadesse at sunedison.com
Wed Nov 23 12:31:21 EST 2011


Hi Everyone,

Can we use rsplit function on an array or vector of strings ? it works
for one not for vector

Alemu


-----Original Message-----
From: python-list-bounces+atadesse=sunedison.com at python.org
[mailto:python-list-bounces+atadesse=sunedison.com at python.org] On Behalf
Of Massi
Sent: Wednesday, November 23, 2011 10:10 AM
To: python-list at python.org
Subject: String splitting by spaces question

Hi everyone,

I have to parse a string and splitting it by spaces. The problem is
that the string can include substrings comprises by quotations which
must mantain the spaces. What I need is to pass from a string like:

This is an 'example string'

to the following vector:

["This", "is", "an", "example string"]

Which is the best way to achieve this?
Thanks in advance!
-- 
http://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list