I'm so sorry to ask such a simple question... A day ago, I started learning Rust and tried the println!
method.
fn main() {
println!("Hello {}!", "world");
}
-> Hello world!
And then, I found other format styles: {}, {:}, {:?}, {?}
, ...
I know that {}
is instead String
, but I don't understand the other format style. How do those styles differ from each other? I think {:?}
is array or vector. Is it correct?
Please explain these format style with sample code :(
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…