splitting a string into 2 new strings

Mark Light light at soton.ac.uk
Wed Jul 2 07:02:36 EDT 2003


Hi,
      I have a string e.g. 'C6 H12 O6' that I wish to split up to give 2
strings
'C H O' and '6 12 6'.  I have played with string.split() and the re module -
but can't quite get there.

Any help would be greatly appreciated.

Thanks,

Mark.








More information about the Python-list mailing list