// Step 3.
// Apply the `capitalize_first` function again to a slice of string slices.
// Return a single string.
// ["hello", " ", "world"] -> "Hello World"
Step 3.
Apply the `capitalize_first` function again to a slice of string slices.
Return a single string.
Step 3 . Apply the ` capitalize_first ` function again to a slice of string slices . Return a single string .
pub fn capitalize_words_string(words: &[&str]) -> String {
    let mut mystring = String::new();
    for i in words {
        let first = match i.chars().next() {
            None=> '\0',
            Some(first) => first
        };
        mystring.push_str(&(first.to_uppercase().to_string() + &i[1..].to_string()));
    }
    mystring
}
pub fn capitalize_words_string ( words : & [ & str ] ) -> String { let mut mystring = String :: new ( ) ; for i in words { let first = match i . chars ( ) . next ( ) { None => '\0' , Some ( first ) => first } ; mystring . push_str ( & ( first . to_uppercase ( ) . to_string ( ) + & i [ 1 .. ] . to_string ( ) ) ) ; } mystring }
Step 3.
Step 3 .
words
&[&str]