escape_string 0.1.2

Efficiently parse backslash-escaped strings
Documentation
  • Coverage
  • 100%
    5 out of 5 items documented0 out of 4 items with examples
  • Size
  • Source code size: 6.73 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.2 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • njaard/sonnerie
    277 21 9
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • njaard

Efficiently split lines by whitespace, while handling the backslash escape sequences in Rust-like string format.

For example, if you had a string like:

  One\ two three\ four

Naïve splitting on whitespace would produce four outputs:

  • One\
  • two
  • three\
  • four

This crate will instead produce two strings:

  • One two
  • three four

This crate also handles special escape sequences like "\n", which represents a newline. Specifically, the escape sequences are:

  • \a
  • \b
  • \t
  • \n
  • \v
  • \f
  • \r
  • \\

If the backslash character is found, but the successive character is not special, then the backslash is disregarded and the successive character is included verbatim.