]> git.lizzy.rs Git - rust.git/commitdiff
Add example with leading zeros
authorStefan Schindler <dns2utf8@estada.ch>
Fri, 24 Jun 2016 23:59:14 +0000 (01:59 +0200)
committerStefan Schindler <dns2utf8@estada.ch>
Fri, 24 Jun 2016 23:59:14 +0000 (01:59 +0200)
src/libcollections/fmt.rs

index 6f77d79ab0bfec4c419241588c42f0c3e97d7156..15de0dd802d99f0a067c6df18d086e1cdb3465b8 100644 (file)
@@ -28,6 +28,7 @@
 //! format!("{:?}", (3, 4));          // => "(3, 4)"
 //! format!("{value}", value=4);      // => "4"
 //! format!("{} {}", 1, 2);           // => "1 2"
+//! format!("{:04}", 42);             // => "0042" with leading zeros
 //! ```
 //!
 //! From these, you can see that the first argument is a format string. It is