You can also try this
>>> a = '<NAME'
>>> a
'<NAME'
>>> a.partition('<')
('', '<', 'NAME')
>>> splitstring = a.partition('<')
>>> splitstring
('', '<', 'NAME')
>>> splitstring[0]
''
>>> splitstring[1]
'<'
>>> splitstring[2]
'NAME'
I guess you can use this tuple.
Hope this helps.
Thanks and Regards,
Sumod
On Fri, May 20, 2011 at 6:42 PM, Spyros Charonis <[email protected]>wrote:
> Hello List,
>
> A quick string processing query. If I have an entry in a list such as
> ['>NAME\n'],
> is there a way to split it into two separate lines:
>
> >
> NAME
>
> _______________________________________________
> Tutor maillist - [email protected]
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
http://spawgi.wordpress.com
We can do it and do it better.
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor