Skip to content
/ splitty Public

A Rust string splitter taking quotes into account

License

Notifications You must be signed in to change notification settings

Canop/splitty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT Latest Version docs Chat on Miaou

splitty

A no-std string splitter for which spaces between quotes aren't separators.

Quotes not starting or ending a substring are handled as ordinary characters.

use splitty::*;

let cmd = "xterm -e \"vi /some/path\"";

let mut token = split_unquoted_char(cmd, ' ')
    .unwrap_quotes(true);

assert_eq!(token.next(), Some("xterm"));
assert_eq!(token.next(), Some("-e"));
assert_eq!(token.next(), Some("vi /some/path"));

About

A Rust string splitter taking quotes into account

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages