escape_string 0.1.2

Efficiently parse backslash-escaped strings
Documentation

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.