Problem with string parsing

wes weston wweston at att.net
Tue Oct 5 11:41:06 EDT 2004


Mike Howard wrote:
> If I do this:
> string.lstrip('1_mature_dt=10-May-2002','1_mature_dt=')
> I get:
> '0-May-2002'
> Which I did not expect
> string.lstrip('1_mature_dt=20-May-2002','1_mature_dt=')
> I get
> '20-May-2002'
> Which I expected
> string.lstrip('1_mature_dt=01-Jun-2003','1_mature_dt=')
> I get
> '01-Jun-2003'
> Which I expected
> 
> Is this a bug or am I doing something wrong?

Mike,
    Note that after the appropriate if:

 >>> '1_mature_dt=10-May-2002'[len('1_mature_dt='):]
'10-May-2002'

wes




More information about the Python-list mailing list