Crates.io | recase |
lib.rs | recase |
version | 0.3.0 |
source | src |
created_at | 2021-12-29 05:04:35.643293 |
updated_at | 2023-07-14 16:43:15.159976 |
description | Changes the convention case of input text. |
homepage | https://github.com/galatea21/recase |
repository | https://github.com/galatea21/recase |
max_upload_size | |
id | 504653 |
size | 25,345 |
Changes the input text to the desired convention case.
 
Add this to your Cargo.toml
:
[dependencies]
recase = "0.3.0"
 
use recase::ReCase;
fn main() {
const INPUT: &str = "Löng and meaningless-Ẽxample_Text";
let recase1 = ReCase::new(INPUT);
let recase2 = ReCase::new(String::from(INPUT));
println!("{}", recase1.snake_case()); // Prints "löng_and_meaningless_ẽxample_text"
println!("{}", recase2.camel_case()); // Prints "löngAndMeaninglessẼxampleText"
}
 
 
 
Heavily influenced by ReCase from techniboogie-dart.