This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Refer to tweet - https://twitter.com/Dave_DotNet/status/1682699744747958274 | |
// This code allocates same 72 bytes in GC Heap. | |
// However this may be slower than string.Create, because DefaultInterpolatedStringHandler is made for more general purpose. | |
// C# 10+ and .NET 6+ | |
string title = "Mr."; | |
string first = "David"; | |
string middle = "Patrick"; | |
string last = "Callan"; |