Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 409 Bytes

GCop626.md

File metadata and controls

19 lines (13 loc) · 409 Bytes

GCop 626

"The condition is unnecessary."

Rule description

A call to Append(...) method of a StringBuilder object will be ignored if the parameter is null or empty string. Therefore it's unnecessary to add such logic in your code.

Example

if (myString.HasValue())
    myStringBuilder.Append(myString);

should be 🡻

myStringBuilder.Append(myString);