Contact: aviboots(AT)netvision.net.il
40,891 questions
53,304 answers
573 users
fn main() { let s = "rust javascript php c c++ python"; if let Some(index) = s.find(' ') { println!("{}", &s[..index]); } } /* run: rust */
fn main() { let s = "rust javascript php c c++ python"; let first_word = s .split_whitespace() .next() .unwrap_or(""); println!("{}", first_word); } /* run: rust */