Syntax

Rust Print Output Syntax

In Rust, print output: prints a formatted line — println!("Hello {}", name);

Quick Answer

Syntax
println!("Hello {}", name);
RustSyntax

Print Output

Code example
println!("Hello {}", name);

Prints a formatted line.

Learn More

How to print output in Rust

  1. Open your Rust file or editor.
  2. Copy the example, then replace its sample names and values for your code.

Rust Print Output Syntax

Use println!("Hello {}", name);.

Related Syntax References

Frequently asked questions

What is the Rust syntax for print output?

Use this pattern: println!("Hello {}", name);

Can I copy this Rust code example?

Yes. Use Copy code and adapt the example to your program.

Is this Rust syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify