On Fri, 28 Mar 2008 15:48:09 -0700, Kelie wrote: > Is there such a function included in the standard Python distribution?
AFAIK not. > This is what I came up with. How to improve it? Thanks. > > def lstrip2(s, chars, ingoreCase = True): > if ingoreCase: > s2 = s.upper().lstrip(chars.upper()) > return s[len(s)-len(s2):] > else: > return s.lstrip(chars) 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 -- http://mail.python.org/mailman/listinfo/python-list