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 @   lishidefengchen  阅读(127)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决
历史上的今天:
2019-03-28 cmder 常用快捷键
2019-03-28 CentOS7安装RabbitMQ
2019-03-28 linux 检测服务器端口工具
2019-03-28 一款不错的Linux终端颜色设置
2018-03-28 Ubuntu系统安装WeChat
点击右上角即可分享
微信分享提示