ReSharper 2026.3 Help

代码检查:空字符串样式

在 C# 中,你可以通过空字符串字面量 "" 或 string.Empty 属性为变量赋空字符串。 ReSharper allows you to specify the style for empty strings and enforce this style in a specific scope.

默认情况下,ReSharper 建议使用空字符串字面量 "" ,并报告 string.Empty 属性的用法——会 高亮此类用法,并建议相应的 快速修复或 在范围内修复。

有关配置和强制执行空字符串偏好的更多信息,请参阅 代码语法样式:空字符串。

2026年 11月 6日