← All recipes
Moderne licensed

Use string.StartsWith(char)/EndsWith(char) overload

Recipe IDOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net6.UseStringStartsEndsWithCharArtifactOpenRewrite.Recipes.CSharp.Migration.Dotnet

Finds calls to string.StartsWith("x") and string.EndsWith("x") with a single-character string literal that could use the char overload for better performance.

Single recipemodernizationcsharpdotnetProprietary

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.Migration.Dotnet.Net6.UseStringStartsEndsWithChar

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

mod config recipes nuget install OpenRewrite.Recipes.CSharp.Migration.Dotnet