String help

Mark McEahern marklists at mceahern.com
Mon Oct 7 15:50:57 CEST 2002


> Hi, I got
> a string = "aaa,bbb,ccc"
> I want to seperate the string into 3 string "aaa" "bbb" "ccc"
> How do I do it?

$ python
Python 2.2.1 (#1, Jun 25 2002, 10:55:46)
[GCC 2.95.3-5 (cygwin special)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> s = "aaa,bbb,ccc"
>>> a = s.split(",")
>>> a
['aaa', 'bbb', 'ccc']
>>>





More information about the Python-list mailing list