[Tutor] Split a string into characters

Hans Dushanthakumar Hans.Dushanthakumar at navman.com
Tue Aug 23 03:18:43 CEST 2005


Hi,
   A quick one...
   How do I split a string like "Hans" into a list of characters
['H','a','n','s']?
Note that there are no spaces in the original string.
   Str.split() without any arguments looks for whitespace as splitting
character. So, this doesn't serve the purpose.
And str.split("") appears to be illegal.
Cheers
Hans


More information about the Tutor mailing list