fn disemvowel(s: &str) -> String {
    let mut input_chars = s.chars().peekable();
    let mut output = String::new();
    while let Some(c) = input_chars.next() {
        match c {
            'a' | 'e' | 'i' | 'o' | 'u' | 'A' | 'E' | 'I' | 'O' | 'U' => {} 
            _ => output.push(c) 
        }
    }  
    String::from(output) 
}
/*
This method will peek at the characters of the input string. It loops through the string using Some(c) which means
as long as there are still some characters to look at look at the next character. If the next character matches a vowel,
nothing is done, so it's essentially skipped. _ => output.push(c) will look at any other character in the input string and
push it to the newly created output string. The disemvoweled string is then returned
*/
This method will peek at the characters of the input string. It loops through the string using Some(c) which means
as long as there are still some characters to look at look at the next character. If the next character matches a vowel,
nothing is done, so it's essentially skipped. _ => output.push(c) will look at any other character in the input string and
push it to the newly created output string. The disemvoweled string is then returned
This method will peek at the characters of the input string . It loops through the string using Some ( c ) which means as long as there are still some characters to look at look at the next character . If the next character matches a vowel nothing is done so it ' s essentially skipped . _ = > output . push ( c ) will look at any other character in the input string and push it to the newly created output string . The disemvoweled string is then returned
fn disemvowel(s: &str) -> String {
    let mut input_chars = s.chars().peekable();
    let mut output = String::new();
    while let Some(c) = input_chars.next() {
        match c {
            'a' | 'e' | 'i' | 'o' | 'u' | 'A' | 'E' | 'I' | 'O' | 'U' => {} 
            _ => output.push(c) 
        }
    }  
    String::from(output) 
}
fn disemvowel ( s : & str ) -> String { let mut input_chars = s . chars ( ) . peekable ( ) ; let mut output = String :: new ( ) ; while let Some ( c ) = input_chars . next ( ) { match c { 'a' | 'e' | 'i' | 'o' | 'u' | 'A' | 'E' | 'I' | 'O' | 'U' => { } _ => output . push ( c ) } } String :: from ( output ) }
This method will peek at the characters of the input string.
This method will peek at the characters of the input string .
s
&str
s
&str