use regex::Regex;
fn main() {
let mut s = "rust golang c# java c c++ java java python".to_string();
let toremove = "java";
s = s.replace(toremove, "");
let whitespace_regex = Regex::new(r"\s+").unwrap();
s = whitespace_regex.replace_all(&s, " ").to_string();
println!("{}", s);
}
/*
run:
rust golang c# c c++ python
*/