Crates.io | snakecase |
lib.rs | snakecase |
version | 0.1.0 |
source | src |
created_at | 2019-07-24 04:51:24.943576 |
updated_at | 2019-07-24 04:51:24.943576 |
description | Snakecase is a general purpose snakecase implementation supporting both ascii and unicode. |
homepage | |
repository | https://github.com/rust-playground/snakecase |
max_upload_size | |
id | 151243 |
size | 32,556 |
Snakecase is a general purpose snakecase implementation supporting both ascii and unicode.
Notes: Its algorithm is designed to provide feature parity with this Go snakecase library, but PR's will be accepted for other algorithms and can be hidden behind a feature flag.
[dependencies]
snakecase = "0.1"
use snakecase::ascii::to_snakecase;
fn main() {
let input = "sample text";
println!("{} => {}", input, to_snakecase(input));
}
or when you need unicode support
use snakecase::unicode::to_snakecase;
fn main() {
let input = "ƒun sample text";
println!("{} => {}", input, to_snakecase(input));
}