3 ms·
No, I wasn't suggesting that you could implement the same high-performance System.String in IL, especially considering the assembly language used. I was just sa
by jsingleton 10y ago
No, I wasn't suggesting that you could implement the same high-performance System.String in IL, especially considering the assembly language used. I was just saying that there are many other things that can't be done in C# but are possible in .NET, using other languages.
BTW there is a typo: "passed in my the calling code" should probably be "passed in by the calling code".
I wonder if the new C# 6 string interpolation also uses string builder like format does. e.g.
$"Name = {name}, hours = {hours:hh}"
https://msdn.microsoft.com/en-us/library/Dn961160.aspx https://msdn.microsoft.com/en-us/library/Dn961160.aspx
This post seems to suggest it uses concatenation, which may be bad for performance in some situations due to the immutability.
https://weblogs.asp.net/bleroy/c-6-string-interpolation-is-not-a-templating-engine-and-it-s-not-the-new-string-format https://weblogs.asp.net/bleroy/c-6-string-interpolation-is-n...
- matthewwarren 10y agoI just did a quick test with Reflector and it looks like string interpolation is turned into String.Format(..) calls, which in turn will use StringBuilder. This makes sense as String.Format(..) understands all the string formatting placeholders. > BTW there is a typo: "passed in my the calling code" should probably be "passed in by the calling code". Thanks for spotting that, I'll fix it in a bit