Skip to content

A rust utility that slices string slices into smaller string slices

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

squishy-clouds/slicer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slicer

A simple, efficient utility for slicing string slices into smaller string slices. Useful for parsing anything represented by strings, such as programming languages or data formats.

Examples

Basic usage:

use slicer::AsSlicer;

let path = "images/cat.jpeg";
let mut slicer = path.as_slicer();

let directory = slicer.slice_until("/");
slicer.skip_over("/");
let filename = slicer.slice_until(".");
slicer.skip_over(".");
let extension = slicer.slice_to_end();

assert_eq!(Some("images"), directory);
assert_eq!(Some("cat"), filename);
assert_eq!(Some("jpeg"), extension);

License

This crate is licensed under the terms of both the MIT License and the Apache License 2.0.

About

A rust utility that slices string slices into smaller string slices

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages