[Tutor] Creating a list from a comma-seperated string.

Deirdre Saoirse deirdre@deirdre.net
Tue, 19 Mar 2002 11:55:00 -0800 (PST)


On Tue, 19 Mar 2002 Doug.Shawhan@gecits.ge.com wrote:

> I know this is probably very simple.
>
> I have strings of comma-seperated text that I want to split into lists.
>
> split() of course, seperates every letter. How do I tell split() to do it's
> business at the commas?

split takes an optional second argument:

no_commas_please = string.split(string_with_commas, ',')

--
_Deirdre                                              http://deirdre.net
"I love deadlines. I like the whooshing sound they make as they fly by."
                                                         - Douglas Adams