Explain how string interning works in .NET and when it becomes harmful.

Expert C#

Answer

Intern pool stores unique string instances for process lifetime.

Benefits: deduplication of literals. Harmful: unbounded memory use if interning user input.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice