Transform a string between camelCase
, PascalCase
, Capital Case
, snake_case
, param-case
, CONSTANT_CASE
and others.
Add this to your Cargo.toml
:
toml
[dependencies]
change-case = "0.1"
```rust use change_case::*;
asserteq!(camelcase("Test String"), "testString"); asserteq!(captialcase("test string"), "Test String"); asserteq!(constantcase("test string"), "TESTSTRING"); asserteq!(dotcase("test string"), "test.string"); asserteq!(headercase("test string"), "Test-String"); asserteq!(paramcase("test string"), "test-string"); asserteq!(pascalcase("test string"), "TestString"); asserteq!(pathcase("test string"), "test/string"); asserteq!(sentencecase("Test String"), "Test string"); asserteq!(snakecase("Test String"), "teststring"); asserteq!(swapcase("Test String"), "tEST sTRING"); asserteq!(titlecase("this vs that"), "This vs That"); ```
MIT