pub fn matches_length(a: &str, b: &str) {
if a.len() != b.len() {
panic!("Parameter 1 does not match the string length as parameter 2")
}
}
pub fn contains_special_characters(a: &str) -> bool {
let special_characters = [
"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "-", "_", "=", "+", "[", "]",
"{", "}", ";", ":", "'", "\"", "\\", "|", ",", ".", "<", ">", "/", "?", "`", "~"
];
for character in special_characters {
if a.contains(character) {
return true
}
}
false
}
pub fn contains_numbers(a: &str) -> bool {
let numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
let contains_numbers = numbers
.iter()
.any(|&number| a.contains(number));
if contains_numbers {
true
} else {
false
}
}