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要更優。

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