Eryk Sun <eryk...@gmail.com> added the comment:
Python 3.9 added str.removeprefix() and str.removesuffix() [1]: >>> "data_prj_t_suffix".removeprefix('data_prj_').removesuffix('_suffix') 't' [1] https://docs.python.org/3/library/stdtypes.html#str.removeprefix ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42397> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com