Howto parse a string using a char in python

David Robinow drobinow at gmail.com
Sat Feb 16 00:19:09 CET 2013


On Fri, Feb 15, 2013 at 6:04 PM, Steve Goodwin <sgoodwin at cfl.rr.com> wrote:
> Hi,
>
> I am looking for the python2.7 function(s) to parse a string from a colon
> character ":"
>
> Sounds simple enough.
>
> For example, a string like "123456:789".  I just need the "123456"
> substring.(left of the :)
"123456:789".split(":")[0]



More information about the Python-list mailing list