voca_rs Build Status Crates version dependency status codecov Codacy Badge license

Voca_rs is a Rust library for manipulating [unicode] strings.

Voca_rs is inspired by Voca.js (JavaScript), string.py (Python), Inflector (Rust), and Grafite (PHP).

Voca_rs is implemented on Foreign Types, i.e. String and str. Respects Unicode.

TL;DR

Using functions:

```rust use voca_rs::*;

let inputstring = "LazyLoad with XMLHttpRequest and snakecase"; let stringinwords = split::words(&inputstring); // => ["Lazy", "Load", "with", "XML", "Http", "Request", "and", "snake", "case"] let wordsinstring = &stringinwords.join(" "); // => "Lazy Load with XML Http Request and snake case" let truncatedstring = chop::prune(&wordsinstring, 21, ""); // => "Lazy Load with XML..." let slicedstring = chop::slice(&truncatedstring, 5, -2); // => "Load with XML." let snakedstring = case::snakecase(&slicedstring); // => "loadwith_xml" ```

Using traits (all methods start from the underscore symbol):

```rust use voca_rs::Voca;

"LazyLoad with XMLHttpRequest and snakecase" .words() // => ["Lazy", "Load", "with", "XML", "Http", "Request", "and", "snake", "case"] .join(" ") // => "Lazy Load with XML Http Request and snake case" .prune(21, "") // => "Lazy Load with XML..." .slice(5, -2) // => "Load with XML." .snakecase(); // => "loadwithxml" ```

Documentation

See the complete documentation at https://e1r0nd.github.io/voca_rs/

Run tests: cargo test
Build docs: cargo doc -> ./target/doc/voca_rs/index.html
Build a project: cargo build -> ./target/debug

Functions

Case

Chop

Count

Escape

Index

Manipulate

Query

Split

Strip

Utils

Roadmap

Chop

Format

Manipulate

Copyright

coded by Anatol Marezhanyi @e1r0nd_crg

https://linkedin.com/in/merezhany/
https://www.youtube.com/c/AnatolMerezhanyi

License

Licensed under MIT License