Formatting strings

Reading through the Rust-book ( to try to learn Rust, I saw this:

let s = format!("{}-{}-{}", s1, s2, s3);

but a syntax that I really liked in C# is this (because it is shorter):

var s = $"{s1}-{s2}-{s3}";

Is there something similar in Rust where you add the variable where they should be, instead of in comma separated list after the format string? Is it something that is planned to be added to the language?

Generally, If can be done with macro, there is no need to add it to the language.


Wow, cool, this language (and all crates available) starts to impress me more and more.

Thanks @Fiedzia...

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.