MCPcopy Index your code
hub / github.com/RustPython/RustPython / removeprefix

Method removeprefix

crates/vm/src/builtins/str.rs:933–937  ·  view source on GitHub ↗
(&self, pref: PyStrRef)

Source from the content-addressed store, hash-verified

931
932 #[pymethod]
933 fn removeprefix(&self, pref: PyStrRef) -> Wtf8Buf {
934 self.as_wtf8()
935 .py_removeprefix(pref.as_wtf8(), pref.byte_len(), |s, p| s.starts_with(p))
936 .to_owned()
937 }
938
939 #[pymethod]
940 fn removesuffix(&self, suffix: PyStrRef) -> Wtf8Buf {

Callers

nothing calls this directly

Calls 5

py_removeprefixMethod · 0.80
starts_withMethod · 0.80
to_ownedMethod · 0.45
as_wtf8Method · 0.45
byte_lenMethod · 0.45

Tested by

no test coverage detected