String splitting by spaces question

Massi massi_srb at msn.com
Wed Nov 23 12:10:09 EST 2011


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!



More information about the Python-list mailing list