(&self, w: impl AsRef<Wtf8>)
| 1169 | } |
| 1170 | |
| 1171 | pub fn strip_suffix(&self, w: impl AsRef<Wtf8>) -> Option<&Self> { |
| 1172 | self.bytes |
| 1173 | .strip_suffix(w.as_ref().as_bytes()) |
| 1174 | .map(|w| unsafe { Wtf8::from_bytes_unchecked(w) }) |
| 1175 | } |
| 1176 | |
| 1177 | pub fn replace(&self, from: &Wtf8, to: &Wtf8) -> Wtf8Buf { |
| 1178 | let w = self.bytes.replace(from, to); |