split-optional 1.0.0

It split from a source `str` to `Option<&'a str>` per an element.
Documentation
  • Coverage
  • 0%
    0 out of 9 items documented0 out of 7 items with examples
  • Size
  • Source code size: 6.56 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.33 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • usagi/split-optional
    1 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • usagi

split-optional

It split from a source str to Option<&'a str> per an element.

Usage | Example

fn main()
{
 const SOME_INPUT: &str = "aaa,bbb,ccc";

 // (Some("aaa"), Some("bbb,ccc"))
 let result = split_optional::split2(SOME_INPUT, ",");
 println!("{result:?}");

 // (Some("aaa"), Some("bbb"), Some("ccc"))
 let result = split_optional::split3(SOME_INPUT, ",");
 println!("{result:?}");

 // (Some("aaa"), Some("bbb"), Some("ccc"), None)
 let result = split_optional::split4(SOME_INPUT, ",");
 println!("{result:?}");

 // (Some("aaa"), Some("bbb"), Some("ccc"), None, None)
 let result = split_optional::split5(SOME_INPUT, ",");
 println!("{result:?}");
}

License

Author