Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn return_words(input: &str) -> Vec<&str> {
- let words = input.split_whitespace();
- let mut word_vec = Vec::new();
- for word in words {
- word_vec.push(word);
- }
- word_vec
- }
- fn main() {
- println!("{:?}", return_words("potato cucumber santa snek"));
- }
Add Comment
Please, Sign In to add comment