Brandon wrote:
How do I convert a string to a char array? I am doing this so I can edit the string received from an sql query so I can remove unnecessary characters.

The precise answer is:

>>> s = 'abcdefghi'
>>> l = list(s)
>>> l
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
>>>

But quite often you can just to the replace without doing the conversion

>>> s = 'abc,de,fghi'
>>> s2 = s.replace(',','')
>>> s2 = s.replace(',','')
'abcdefghi'
>>>

-Larry
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to