StringBuilder
or some such under the hood. It turns out it merely creates a good, old-fashioned String.Format statement out of it.Given this source code:
The resulting IL (compiled) code is the following (obtained using LINQPad):
Note the following two statements:
ldstr "A{0}C" call System.String.FormatThese indicate that String.Format is being called with the familiar-looking format string
"A{0}C"
.To compile the C# code and create IL code, I used Joe Albahari's excellent LINQPad program.