Skip to main content

replace_ascii

Function replace_ascii 

Source
unsafe fn replace_ascii(utf8_bytes: &[u8], from: u8, to: u8) -> String
Expand description

Faster implementation of string replacement for ASCII to ASCII cases. Should produce fast vectorized code.

§Safety

  • utf8_bytes must contain valid UTF-8.
  • Both from and to must be ASCII bytes (at most 0x7F).