Add string.Create documentation to "Create new strings in .NET"#52316
Open
Add string.Create documentation to "Create new strings in .NET"#52316
Conversation
…ppets Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [c76a8206] Add string.Create method to documentation
Add string.Create documentation to "Create new strings in .NET"
Mar 16, 2026
BillWagner
approved these changes
Mar 16, 2026
Member
BillWagner
left a comment
There was a problem hiding this comment.
This is ready for final review.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Create new strings in .NET documentation to cover modern high-performance string creation APIs (string.Create and the string(ReadOnlySpan<char>) constructor), and adds runnable C# and Visual Basic snippets to accompany the new content.
Changes:
- Adds a
string(ReadOnlySpan<char>)mention in the constructor section, and addsstring.Createto the methods table. - Introduces a new Create section describing how
string.Createworks and when to use it vs.stackalloc+new string(span). - Adds new C# and VB snippet projects under
docs/standard/base-types/snippets/creating-new/.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/standard/base-types/creating-new.md | Adds string.Create coverage, constructor overload mention, and new guidance section with embedded snippets. |
| docs/standard/base-types/snippets/creating-new/csharp/creating-new.csproj | New C# snippet project to build and run sample code used by the article. |
| docs/standard/base-types/snippets/creating-new/csharp/Program.cs | Adds UsingSpanConstructor and UsingStringCreate C# snippet regions. |
| docs/standard/base-types/snippets/creating-new/vb/creating-new.vbproj | New VB snippet project for the String.Create example. |
| docs/standard/base-types/snippets/creating-new/vb/Program.vb | Adds UsingStringCreate VB snippet region. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
gewarren
reviewed
Mar 16, 2026
BillWagner
reviewed
Mar 16, 2026
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Create new strings in .NET" article had no coverage of
string.Create()or thestring(ReadOnlySpan<char>)constructor overload.Article updates (
creating-new.md)string(ReadOnlySpan<char>)in the constructor sectionstring.Createto the methods reference tablestring.Createworks (single allocation; runtime passes backing buffer directly to callback asSpan<char>)string.Createandstackalloc+new string(span): stack vs. heap pressure, size limits, and boxing behavior of the state parameterNew snippets
Both C# and VB projects added under
docs/standard/base-types/snippets/creating-new/.Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.
Internal previews