change-case

Crates.iochange-case
lib.rschange-case
version0.2.0
sourcesrc
created_at2020-09-09 12:02:19.434756
updated_at2020-09-10 09:22:09.729646
descriptionTransform a string between camelCase, PascalCase, Capital Case, snake_case, param-case, CONSTANT_CASE and others.
homepagehttps://github.com/sigoden/change-case
repositoryhttps://github.com/sigoden/change-case
max_upload_size
id286653
size24,282
(sigoden)

documentation

README

Change Case

Build status crates.io Documentation Rust

Transform a string between camelCase, PascalCase, Capital Case, snake_case, param-case, CONSTANT_CASE and others.

Usage

Add this to your Cargo.toml:

[dependencies]
change-case = "0.1"
use change_case::*;

assert_eq!(camel_case("Test String"), "testString");
assert_eq!(captial_case("test string"), "Test String");
assert_eq!(constant_case("test string"), "TEST_STRING");
assert_eq!(dot_case("test string"), "test.string");
assert_eq!(header_case("test string"), "Test-String");
assert_eq!(param_case("test string"), "test-string");
assert_eq!(pascal_case("test string"), "TestString");
assert_eq!(path_case("test string"), "test/string");
assert_eq!(sentence_case("Test String"), "Test string");
assert_eq!(snake_case("Test String"), "test_string");
assert_eq!(swap_case("Test String"), "tEST sTRING");
assert_eq!(title_case("this vs that"), "This vs That");

License

MIT

Commit count: 7

cargo fmt