format!
Returns the formatted text without printing it.
Syntax
format!("{}", value)Description
Formats like println! but does not print to the screen; returns a String.
Example
Loading editor…
Expected output
Score: 95
When to use?
Creating and storing text.