Permalink
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (25 sloc) 795 Bytes

RCS1128: Use coalesce expression

Property Value
Id RCS1128
Category Simplification
Default Severity Info
Enabled by Default
Supports Fade-Out -
Supports Fade-Out Analyzer -

Example

Code with Diagnostic

string s = GetValue(); // RCS1128

if (s == null)
{
    s = "";
}

Code with Fix

string s = GetValue() ?? "";

See Also

(Generated with DotMarkdown)