case insensitive lstrip function?

Kelie kf9150 at gmail.com
Fri Mar 28 20:02:51 EDT 2008


On Mar 28, 12:55 pm, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
> What about this:
>
> def lstrip2(string, chars, ignore_case=True):
>     if ignore_case:
>         chars = chars.lower() + chars.upper()
>     return string.lstrip(chars)
>
> Ciao,
>         Marc 'BlackJack' Rintsch

Thanks Marc. I think yours looks much better.



More information about the Python-list mailing list