If you’ve created long strings using string interpolation ($) and hit enter to prevent horizontal scroll Visual Studio will + two interpolated strings together.
In .NET 5 and below this didn’t really matter as string concat via + and $ both delegated to String.Concat(). In NET 6 interpolation works different and is faster and more memory efficient so FYI there is a performance difference.. whether it affects you completely depends on your scenario.
Some example benchmarks below…
Click on the image for a larger view in a new tab.
Need Help with Your C# Projects?
We offer expert support and development services for projects of any size. Contact us for a free consultation and see how we can help you succeed.
CONTACT US NOW