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.

Author redrose2100
Recipients redrose2100
Date 2021-06-26.04:22:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1624681343.46.0.141247598588.issue44513@roundup.psfhosted.org>
In-reply-to
Content
for string methods strip, lstrip, rstrip, when param is a string which has more than 1 char, currently those methods remove char ,but not remove string , it is no useful

following is the results in python 3.9.5

Python 3.9.5 (default, May 18 2021, 14:42:02) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> s="hellolloehb"
>>> print(s.lstrip("hello"))
b
>>> s="blloehhello"
>>> print(s.rstrip("hello"))
b
>>> s="helloehhollbllohhehello"
>>> print(s.strip("hello"))
b
>>>
In fact,
when s="hellolloehb" , s.lstrip("hello") expect to get "lloehb"
when s="blloehhello" , s.rstrip("hello") expect to get "blloeh"
when s="helloehhollbllohhehello" , s.strip("hello") expect to get "ehhollbllohhe"
History
Date User Action Args
2021-06-26 04:22:23redrose2100setrecipients: + redrose2100
2021-06-26 04:22:23redrose2100setmessageid: <1624681343.46.0.141247598588.issue44513@roundup.psfhosted.org>
2021-06-26 04:22:23redrose2100linkissue44513 messages
2021-06-26 04:22:23redrose2100create