Skip to content
masterclass Buddy

Rust · Macro

format!

Creates a new String by inserting runtime expressions into a string literal. Braces choose the values and can include formatting options.

Last updated

Since
1.0.0

Syntax

format!(format_string, arguments...)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • std::fmt
  • format_args!
  • print!
  • println!
  • write!
  • writeln!
  • to_string
  • concat!

Source: format in std - Rust. Checked 2026-11-03.