Skip to main content

RCS1078: Use "" or 'string.Empty'

Properties

PropertyValue
Default Severitydisabled by default
Minimum language version-

Examples

Example #1

diagnostic.cs
string s = string.Empty;
fix.cs
string s = "";

Configuration

info

Option roslynator_empty_string_style is required to be set for this analyzer to work.

.editorconfig
# Prefer 'string.Empty' or empty string literal
roslynator_empty_string_style = field|literal

Applies to