Christian Heimes added the comment:
Please read the documentation again. lstrip doesn't work like you assume:
>>> "cbaabcdef".lstrip("abc")
'def'
--
nosy: +christian.heimes
___
Python tracker
Narendra L added the comment:
If you see output dttrace e is missing
see working example
>>> test = "Cookie: test-Debug=edttrace=expires=1517828996"
>>> test.lstrip('Cookie: test-Debug=')
'dttrace=expires=1517828996'
# e missing here
>>> test = "Cookie:
Serhiy Storchaka added the comment:
It works as documented. Removes characters specified by the argument from the
string. In your example the argument contains "e", but doesn't contain "d".
Therefore starting characters up to "d" have been removed.
--
New submission from Narendra L :
Lstrip not working as expected when the string has "=e" in it.
Python 2.7.11 (default, Jan 22 2016, 08:28:37)
>>> test = "Cookie: test-Debug=edttrace=expires=1517828996"
>>> test.lstrip('Cookie: test-Debug=')
'dttrace=expires=1517828996'