pub fn capitalize_words_vector(words: &[&str]) -> Vec<String> {
    let mut capvec = vec![];
    for i in words {
        let first = match i.chars().next() {
            None=> '\0',
            Some(first) => first
        };
        //println!("{}",first);
        let mystring: String = first.to_uppercase().to_string() + (&i[1..]);
        capvec.push(mystring);
    }
    capvec
}
// Step 2.
// Apply the `capitalize_first` function to a slice of string slices.
// Return a vector of strings.
// ["hello", "world"] -> ["Hello", "World"]
Step 2.
Apply the `capitalize_first` function to a slice of string slices.
Return a vector of strings.
Step 2 . Apply the ` capitalize_first ` function to a slice of string slices . Return a vector of strings .
pub fn capitalize_words_vector(words: &[&str]) -> Vec<String> {
    let mut capvec = vec![];
    for i in words {
        let first = match i.chars().next() {
            None=> '\0',
            Some(first) => first
        };
        //println!("{}",first);
        let mystring: String = first.to_uppercase().to_string() + (&i[1..]);
        capvec.push(mystring);
    }
    capvec
}
pub fn capitalize_words_vector ( words : & [ & str ] ) -> Vec < String > { let mut capvec = vec ! [ ] ; for i in words { let first = match i . chars ( ) . next ( ) { None => '\0' , Some ( first ) => first } ; //println!("{}",first); let mystring : String = first . to_uppercase ( ) . to_string ( ) + ( & i [ 1 .. ] ) ; capvec . push ( mystring ) ; } capvec }
Step 2.
Step 2 .
words
&[&str]
words
&[&str]