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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/// Checks if parameter 1 is the same length as parameter 2
///
/// # Example:
/// ```rust
/// use r_unit::string;
///
/// let str1 = "hi";
/// let str2 = "hi";
///
/// if string::matches_length(&str1, &str2) {
/// println!("Matches string length.");
/// } else {
/// println!("Does not match string length.");
/// };
/// ```
/// Check if parameter 1 contains special characters or not, returns true or false
///
/// # Example:
/// ```rust
/// use r_unit::string;
///
/// let string = "hi %";
///
/// if string::contains_special_characters(&string) {
/// println!("Contains special characters.");
/// } else {
/// println!("Does not contain special characters.");
/// };
/// ```
/// Check if parameter 1 contains numbers in a string slice or not, returns true or false
///
/// # Example:
/// ```rust
/// use r_unit::string;
///
/// let string = "hi 3";
///
/// if string::contains_numbers(&string) {
/// println!("Contains special characters.");
/// } else {
/// println!("Does not contain special characters.");
/// };
/// ```
/// Check if parameter 1 contains any capital letters in a string slice or not, returns true or false
///
/// # Example:
/// ```rust
/// use r_unit::string;
///
/// let string = "Hi";
///
/// if string::contains_capital_letters(&string) {
/// println!("Contains special characters.");
/// } else {
/// println!("Does not contain special characters.");
/// };
/// ```
/// Check if parameter 1 contains default password requirements, returns true or false.
/// # Default requirements:
/// ```text
/// contains at least 1 capital letter
/// contains at least 1 number
/// contains at least 1 special character
/// contains at least 8 characters
/// ```
///
/// # Example:
/// ```rust
/// use r_unit::string;
///
/// let password = "jh+Tr%7f";
///
/// if string::secure_password(&password) {
/// println!("Is a secure password.");
/// } else {
/// println!("Is not a secure password.");
/// };
/// ```
/// Check if parameter 1 contains any whitespace, returns true or false
///
/// # Example:
/// ```rust
/// use r_unit::string;
///
/// let string = "h i";
///
/// if string::contains_whitespace(&string) {
/// println!("Contains white space.");
/// } else {
/// println!("Does not contain white space.");
/// };
/// ```