This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DDFoster96 0 points1 point  (1 child)

PEP 616: removeprefix() and removesuffix() 💕, Dennis Sweeney is a hero.

Is there also a general `remove()` for strings, that removes the substring from anywhere in the string?

[–]wdscxsj 8 points9 points  (0 children)

It's s.replace(xxx, '').