1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! `ncase` [ɪn'keɪs] is a library to enforce case styles.
//!
//! ## Usage
//!
//! Use the [free functions](#functions) for one-off case conversions.
//! They automatically split the input string into words just as
//! [`Words::from`]
//!
//! ```
//! assert_eq!(ncase::camel("camel case"), "camelCase");
//! assert_eq!(ncase::snake("snake case"), "snake_case");
//! ```
//!
//! Use [`Words`] if you need to convert one string into many case styles
//!
//! ```
//! use ncase::Words;
//!
//! let s = "Lorem ipsum dolor sit amet";
//! let w = Words::from(s);
//!
//! assert_eq!(w.kebab(), "lorem-ipsum-dolor-sit-amet");
//! assert_eq!(w.title(), "Lorem Ipsum Dolor Sit Amet");
//! ```
//!
//! Or if you want to use a separator regex (the `regex` feature)
//!
//! ```
//! use ncase::Words;
//! use regex::Regex;
//!
//! let s = "Lorem, ipsum (dolor _sit)_ amet";
//! let sep = Regex::new(r"[\pP\s]+").unwrap();
//! let w = Words::with_separator(s, &sep);
//!
//! assert_eq!(w.lower(), "lorem ipsum dolor sit amet");
//! assert_eq!(w.upper(), "LOREM IPSUM DOLOR SIT AMET");
//! ```
//!
//! ## Features
//!
//! `regex`
//! : Enables [`Words::with_separator`] in the library and `-F <separator>`
//! in the binary. Adds the `regex` dependency.
//!
//! `rand`
//! : Enables `rANdOm cASe` support. Adds the `rand` dependency.
pub use Words;
free_fn!;
free_fn!;
free_fn!;
free_fn!;
free_fn!;
free_fn!;
free_fn!;
free_fn!;
free_fn!;
free_fn!;
free_fn!;