Question about how string.Format works #87512
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
The way this code is written, there could be a number of external factors influencing any alleged performance numbers. We use BenchmarkDotNet to mitigate these sorts of factors. |
Beta Was this translation helpful? Give feedback.
-
See String Interpolation in C# 10 and .NET 6 for an in-depth write-out about that topic. Also note that |
Beta Was this translation helpful? Give feedback.
See String Interpolation in C# 10 and .NET 6 for an in-depth write-out about that topic.
Also note that
i.ToString
creates a string (so an allocation), that is avoided with the plain string interpolation.