c#基础:string.empty 和 "" 的区别

The difference between string.Empty and "" is very small. String.empty will not create any object while "" will create a new object in the memory for the checking. Hence string.empty is better in memory management.

string.Empty和“”的区别很小。string.empty在内存中不创建对象,而“”会在内存中创建对象。因此,从内存管理的角度来讲,string.empty要更优。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章