We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
to_string()
1 parent 96a17ef commit 22fdebdCopy full SHA for 22fdebd
src/language/strings.md
@@ -162,6 +162,10 @@ let person = Person {
162
println!("{person}");
163
```
164
165
+For converting values to string using `Display` without formatting, you can use
166
+the `std::string::ToString` trait. Its `to_string()` method is equal to the `ToString()`
167
+method in .NET, and implemented automatically whenever you implement `Display`.
168
+
169
Another option is to use the `std::fmt::Debug` trait. The `Debug` trait is
170
implemented for all standard types and can be used to print the internal
171
representation of a type. The following example shows how to use the `derive`
0 commit comments