Primary
str.removeprefix() ⚬|Documentation|1st|20260629135001-00-⌔
Built-in Types — Python 3.14.6 documentation#str.removeprefix
str.removeprefix(prefix,/)If the string starts with the prefix string, return
string[len(prefix):]. Otherwise, return a copy of the original string:>>> 'TestHook'.removeprefix('Test') 'Hook' >>> 'BaseTestCase'.removeprefix('Test') 'BaseTestCase'Added in version 3.9.
See also
removesuffix()andstartswith().Printed 2026-06-29.
(echo:: @ ᯤ)
Link to original
Secondary
• • •