String.Intern() Method

i knew that strings are immutable and that we should use Stringbuilder.

but the method String.Intern(inputString) i didnt know!

- the method looks up the intern string pool for inputString.
- if it founds it, it assigns the reference to thisone.
and it will be not created a new instance of the inputString.



consider memory consumption vs. performance !!!
we have more the performance problem than the memory consumption problem.

Link: Bob On Development » Optimize Memory Consumption Using String Interning

Latest Posts

Popular Posts