Function std::fmt::format
pub fn format(args: &Arguments) -> ~str
The format function takes a precompiled format string and a list of arguments, to return the resulting formatted string.
Arguments
- args - a structure of arguments generated via the
format_args!
macro. Because this structure can only be safely generated at compile-time, this function is safe.
Example
use std::fmt; let s = format_args!(fmt::format, "Hello, {}!", "world"); assert_eq!(s, ~"Hello, world!");