Repository navigation
Add interpolated raw string literal example and System.Text.Json cross-links (Fixes #42727) - #56642
Open
Manish-1kumar wants to merge 2 commits into
Open
Manish-1kumar wants to merge 2 commits into
Manish-1kumar wants to merge 2 commits into
Conversation
Contributor
Author
|
@dotnet-policy-service agree |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The raw-string example reverses Seattle’s latitude and longitude and uses culture-dependent number formatting, producing invalid coordinates and potentially invalid JSON.
2 open issues
What changed in this PR
Addresses #42727 with a concrete interpolated raw string example and links between the C# language reference and System.Text.Json documentation.
Changes:
- Adds a JSON snippet that combines literal braces with interpolated expressions.
- Explains how the number of
$characters controls interpolation delimiters. - Adds reciprocal documentation links and recommends System.Text.Json for structured data serialization.
| File | Description |
|---|---|
docs/standard/serialization/system-text-json/overview.md |
Links to raw string literals for inline JSON examples. |
docs/csharp/language-reference/tokens/snippets/raw-string-literal.cs |
Adds an interpolated raw string JSON example. |
docs/csharp/language-reference/tokens/raw-string.md |
Includes the snippet, clarifies brace syntax, and adds serialization guidance. |
Review effort: Balanced
…s-links
- Add snippet demonstrating combining raw string literals with string interpolation (")
- Add snippet reference and explanation in docs/csharp/language-reference/tokens/raw-string.md
- Add cross-link tip to System.Text.Json overview for structured object serialization
- Add reciprocal cross-link in docs/standard/serialization/system-text-json/overview.md
Fixes dotnet#42727
…nippet Swap latitude and longitude initializers and wrap the raw string interpolation with FormattableString.Invariant to emit valid JSON coordinates across all cultures.
Manish-1kumar
force-pushed
the
users/manish/issue-42727-raw-string-interpolation
branch
from
November 30, 2026 17:40
b4e89ef to
c2cb2c5
Compare
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.

Summary
This pull request addresses #42727 by adding a concrete code example and explanation for combining raw string literals with string interpolation in C#, along with reciprocal cross-links between the raw string literals documentation and System.Text.Json.
Changes Made
New Executable Code Snippet (docs/csharp/language-reference/tokens/snippets/raw-string-literal.cs):
et8.0 with 0 warnings and executes as expected.
Article Update (docs/csharp/language-reference/tokens/raw-string.md):
Reciprocal Link (docs/standard/serialization/system-text-json/overview.md):
Fixes #42727
Internal previews
Build report