← All recipes
Moderne licensed

Optimize StringBuilder.Append usage

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Performance.OptimizeStringBuilderAppendArtifactOpenRewrite.Recipes.CSharp.CodeQuality

Optimize StringBuilder method calls: use char overloads for single-character strings, remove redundant ToString() calls, replace string.Format with AppendFormat, and split string concatenation into chained Append calls.

Single recipecsharpperformancecode-qualityProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe OpenRewrite.Recipes.CSharp.CodeQuality.Performance.OptimizeStringBuilderAppend

If the recipe isn’t available locally, install it with:

mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQuality