Skip to content

Commit 6418cb4

Browse files
committed
Add example with leading zeros
1 parent dc9112f commit 6418cb4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libcollections/fmt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
//! format!("{:?}", (3, 4)); // => "(3, 4)"
2929
//! format!("{value}", value=4); // => "4"
3030
//! format!("{} {}", 1, 2); // => "1 2"
31+
//! format!("{:04}", 42); // => "0042" with leading zeros
3132
//! ```
3233
//!
3334
//! From these, you can see that the first argument is a format string. It is

0 commit comments

Comments
 (0)