shtring

Crates.ioshtring
lib.rsshtring
version0.1.0
sourcesrc
created_at2020-11-06 14:46:10.2838
updated_at2020-11-06 14:46:10.2838
descriptionSplit an input string into arguments by whitespace such that text between matching quotes is combined into a single argument.
homepage
repositoryhttps://github.com/Spanfile/shtring
max_upload_size
id309235
size18,688
(Spanfile)

documentation

README

shtring

Split an input string into arguments by whitespace such that text between matching quotes is combined into a single argument. Additionally, single character escapes are supported and ignored where applicable.

let input = "Hello world! \"This text will be a single argument.\" 'So \"will\" this.' \\\'Escaped quotes are ignored.\\\'";
let output = shtring::split(input)?;
assert_eq!(output, vec![
    "Hello",
    "world!",
    "This text will be a single argument.",
    "So \"will\" this.",
    "\\\'Escaped",
    "quotes",
    "are",
    "ignored.\\\'",
]);
Commit count: 6

cargo fmt