Skip to content

StringBuilder should allow copying directly into other StringBuilders #4606

@JeremyKuhne

Description

@JeremyKuhne

If you're juggling more than one buffer/builder there isn't an optimal way to move data between them.

Append/Insert/Replace and the constructor should be able to take another StringBuilder to avoid unnecessary allocation of strings/char arrays.

One concrete example is normalizing paths on Windows- it is a potentially two stage process of GetFullPathName and GetLongPathName. Many times the input string will exactly match the output string- keeping everything in buffers allows skipping the final ToString() if it matches exactly.

Metadata

Metadata

Assignees

Labels

enhancementProduct code improvement that does NOT require public API changes/additionsoptimizationtenet-performancePerformance related issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions