Skip to content

CA1845: Use span-based 'string.Concat' #10298

@himgoyalmicro

Description

@himgoyalmicro

Link to issue description: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1845

Rule Description:

Calling Substring produces a copy of the extracted substring. By using AsSpan instead of Substring and calling the overload of string.Concat that accepts spans, you can eliminate the unnecessary string allocation.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions