String and StringBuilder - C# Gotcha Interview Questions

preview_player
Показать описание
What is the difference between String and StringBuilder in C# Dotnet? Today we look at what's actually going on in memory when you create a String or use StringBuilder.

Note:
If you are following along with Visual Studio, make sure you have "Enable address-level debugging" checked. To do this, go to:
Debug } Options
Select "Debugging } General"
and make sure "Enable address-level debugging" is checked.
Рекомендации по теме
Комментарии
Автор

I been asked this question. I think the interviwer got more than she was asking, hehe!

luis.e.moreno
Автор

How good you can be ❤🔥
Thanks a lot ❤

soroush_dev
Автор

I don't know for sure, but I guess the "why" is string interning. I.e. identical strings point to the same memory location to conserve memory. If it gets mutated, other variables pointing to the same string will see a different string from what's originally "expected".

flaguser
Автор

3:24 "string kinda rhymes with imm". Thanks for all you do, but not your best work on the memory tricks in my humble opinion.

leviuzodike