How to concatenate different type literals into a string with Rust

1 Answer

0 votes
fn main() {
    let s = concat!("rust", 100, 'x', 3.14, true);

    println!("{:?}", s);
}


    
/*
run:

"rust100x3.14true"
  
*/

 



answered Oct 9, 2024 by avibootz

Related questions

...