Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn normalize(input: &str) -> String {
- let mut normal_input = input.chars().collect::<String>();
- normal_input.retain(|x| x.is_alphanumeric());
- normal_input.make_ascii_lowercase();
- normal_input
- }
- fn find_square_dim(input: &str) -> (u16, u16) {
- let col = (input.len() as f64).sqrt() as u16 + 1_u16;
- let row = (input.len() as f64).sqrt() as u16;
- let tup = (col, row);
- tup
- }
- fn build_square(input: &str, dims: (u16,u16)) -> String {
- let mut word_table: [String:dims.1] = ["", dims.1];
- let mut input_chars = input.chars();
- for code_char in input_chars {
- }
- }
- fn main() {
- let test = "I am excited! Are you excited?";
- println!("{}", normalize(test));
- println!("{:?}", find_square_dim(test));
- }
Add Comment
Please, Sign In to add comment