Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 580 Bytes

File metadata and controls

25 lines (16 loc) · 580 Bytes

Pattern: Missing use of StringBuilder.Append(char)

Issue: -

Description

When calling StringBuilder.Append with a unit length string, consider using a const char rather than a unit length const string to improve performance.

Example of incorrect code:

var stringBuilder = new StringBuilder();
stringBuilder.Append("a");

Example of correct code:

var stringBuilder = new StringBuilder();
stringBuilder.Append('a');

Further Reading