mirror of
https://codeberg.org/icewind/comma-separated.git
synced 2026-06-03 18:24:05 +02:00
initial version
This commit is contained in:
parent
5862c9366a
commit
3595c0924b
2 changed files with 154 additions and 6 deletions
12
README.md
Normal file
12
README.md
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# Comma-separated
|
||||
|
||||
Iterator over a comma-seperated string, ignoring any commas inside quotes
|
||||
|
||||
```rust
|
||||
use comma_separated::CommaSeparatedIterator;
|
||||
fn main() {
|
||||
let input = r#"foo, "bar", 'quoted, part'"#;
|
||||
let iterator = CommaSeparatedIterator::new(input);
|
||||
assert_eq!(vec!["foo", "\"bar\"", "'quoted, part'"], iterator.collect::<Vec<_>>());
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue