Permalink
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (25 sloc) 739 Bytes

RCS1156: Use string.Length instead of comparison with empty string

Property Value
Id RCS1156
Category Usage
Default Severity Info
Enabled by Default
Supports Fade-Out -
Supports Fade-Out Analyzer -

Example

Code with Diagnostic

if (s == "") // RCS1156
{
}

Code with Fix

if (s?.Length == 0)
{
}

See Also

(Generated with DotMarkdown)