gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] help with trimming $


From: Horst Herb
Subject: Re: [Gnumed-devel] help with trimming $
Date: Tue, 1 Mar 2005 15:01:11 +1100
User-agent: KMail/1.7.1

On Tue, 1 Mar 2005 14:51, Tim Churches wrote:
> Am I correct in thinking you just want to keep everything after the first
> space? If so, one efficinet method is to split on spaces, and rejoin all
> but the first element:
>
> mystring = " ".join(mystring.split()[1:])

Far more efficient:

datestr, text = stringtoparse.split(" ", 1)

...
date = parse_date(datestr)

with parse_date parsing as outlined (or using a tried and proven date parsiing 
library)

Horst




reply via email to

[Prev in Thread] Current Thread [Next in Thread]