Skip to content

Do not recommend using Stringbuilder #28315

@Symbai

Description

@Symbai

I was browsing this page which strongly recommends to NOT use StringBuilder. Then few words later it says:

For more information on string marshaling, see Default Marshaling for Strings

This is where I went because I wanted to see how I can change my code to NOT using StringBuilder. However it doesn't show alternatives to StringBuilder instead it also recommends using StringBuilder while the best practices recommends NOT using StringBuilder. This is totally confusing.

I don't know 100% which one is correct but I assume that the best practices is. Because this is where the .NET runtime repo team always redirect people to. If that's true then this example here needs to get updated by following this best practices and showing an example which not uses StringBuilder. Especially because there is a link set on best practices to this page.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions