[][src]Function change_case::constant_case

pub fn constant_case(input: &str) -> String

Change to constant case

use change_case::constant_case;
assert_eq!(constant_case(""), "");
assert_eq!(constant_case("test"), "TEST");
assert_eq!(constant_case("test string"), "TEST_STRING");
assert_eq!(constant_case("Test String"), "TEST_STRING");
assert_eq!(constant_case("dot.case"), "DOT_CASE");
assert_eq!(constant_case("path/case"), "PATH_CASE");
assert_eq!(constant_case("TestV2"), "TEST_V2");
assert_eq!(constant_case("version 1.2.10"), "VERSION_1_2_10");
assert_eq!(constant_case("version 1.21.0"), "VERSION_1_21_0");