Batuhan Taskaya <[email protected]> added the comment:
For 3.9+, you could do exactly what you want with .removesuffix
(/.removeprefix) methods;
>>> test = "external_eeeeeeeee_object"
>>> test.removesuffix("_object")
'external_eeeeeeeee'
----------
nosy: +BTaskaya
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue42313>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com