Howto parse a string using a char in python
Mark Lawrence
breamoreboy at yahoo.co.uk
Fri Feb 15 18:20:06 EST 2013
On 15/02/2013 23:04, Steve Goodwin 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 :)
>
> I have looked at regular expressions and string functions, so far no luck.
> Custom function required?
>
> Thank you.
>
> - Spoog98
>
>
More likely a visit to the opticians :) See
http://docs.python.org/2/library/stdtypes.html#string-methods for the
find and index methods.
--
Cheers.
Mark Lawrence
More information about the Python-list
mailing list