#pascal-case

change-case

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

4 releases

0.2.0 Sep 10, 2020
0.1.2 Sep 9, 2020
0.1.1 Sep 9, 2020
0.1.0 Sep 9, 2020

#10 in #pascal-case

Download history 485/week @ 2024-07-20 710/week @ 2024-07-27 380/week @ 2024-08-03 530/week @ 2024-08-10 507/week @ 2024-08-17 738/week @ 2024-08-24 909/week @ 2024-08-31 1044/week @ 2024-09-07 948/week @ 2024-09-14 1291/week @ 2024-09-21 898/week @ 2024-09-28 1115/week @ 2024-10-05 1144/week @ 2024-10-12 1605/week @ 2024-10-19 1257/week @ 2024-10-26 1298/week @ 2024-11-02

5,410 downloads per month
Used in 9 crates (6 directly)

MIT license

24KB
327 lines

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

Dependencies

~2.4–3.5MB
~61K SLoC