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

posted @ 2022-03-28 15:06  lishidefengchen  阅读(117)  评论(0编辑  收藏  举报