strip() method makes me confused

Bischoop Bischoop at vimart.net
Sat Nov 7 08:40:59 EST 2020


On 2020年11月07日, Frank Millman <frank at chagford.com> wrote:
> On 2020年11月07日 1:28 PM, Frank Millman wrote:
>> On 2020年11月07日 1:03 PM, Bischoop wrote:
>>>> [...]
>>>>>> another example:
>>>>>> text = "this is text, there should be not commas, but as you see there
>>> are still"
>>> y = txt.strip(",")
>>> print(text)
>>>>>> output:
>>> this is text, there should be not commas, but as you see there are still
>>>>>>> P.S. If you wanted to remove all the commas, you could do it like this -
>> y = txt.replace(',', '')
>>
I understand now what is happening thanks. Yes, I know about replace, it
just was bothering me about those examples I've gave earlier. Thanks


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /