The Basic Formatting
Basic Formatting
A single placeholder is used when it is required to print a single value.
We can use multiple placeholders within the println!()
macro. The number of placeholders should be equal to the number of values to be printed.
If we want to convert the value to binary, hexadecimal, or octal write:
In the placeholder for binary, hexadecimal, or octal respectively and in the value specify the number. You can use all three of them or one of them in a single expression.
If we want to convert the value to binary, hexadecimal, or octal write:
In the placeholder for binary, hexadecimal, or octal respectively and in the value specify the number. You can use all three of them or one of them in a single expression.
We can perform basic math and the placeholder gets replaced with the result.
Placeholder for debug trait
Knowledge check
Last updated a year ago.