This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: string object's lstrip function
Type: behavior Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, jsostok
Priority: normal Keywords:

Created on 2008-06-06 07:43 by jsostok, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg67748 - (view) Author: Jura (jsostok) Date: 2008-06-06 07:43
example from command line:

'_element_no_of_hsscch'.lstrip('_element_')
'o_of_hsscch'
'_element_o_of_hsscch'.lstrip('_element_')
'o_of_hsscch'
msg67751 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-06-06 07:49
What did you expect? Quoting from the docs,

"""The chars argument is not a prefix; rather, all combinations of its
values are stripped:

>>> 'www.example.com'.lstrip('cmowz.')
'example.com'
"""
msg67755 - (view) Author: Jura (jsostok) Date: 2008-06-06 08:11
print '_element_no_of_hsscch'.lstrip.__doc__
S.lstrip([chars]) -> string or unicode

Return a copy of the string S with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is unicode, S will be converted to unicode before stripping

Ok, I didn't understand it correctly, because i red only __doc__ from
which is not the functionality clear. I found a workaround for it...

Let's leave it closed.
History
Date User Action Args
2022-04-11 14:56:35adminsetgithub: 47297
2008-06-06 08:11:11jsostoksetmessages: + msg67755
2008-06-06 07:49:34georg.brandlsetstatus: open -> closed
resolution: not a bug
messages: + msg67751
nosy: + georg.brandl
2008-06-06 07:43:19jsostokcreate