Last active
August 21, 2022 09:25
-
-
Save solrevdev/f5157e0e3d5587b73da528562f9d95e6 to your computer and use it in GitHub Desktop.
C# 11 Raw String Literal Example on SharpLab - https://sharplab.io/#gist:f5157e0e3d5587b73da528562f9d95e6
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
| /* | |
| SharpLab tools in Run mode: | |
| • value.Inspect() | |
| • Inspect.Heap(object) | |
| • Inspect.Stack(value) | |
| • Inspect.MemoryGraph(value1, value2, …) | |
| */ | |
| using System; | |
| Console.WriteLine("🌄 C# 11 Raw String Literal Example"); | |
| var name = "John"; | |
| var jsonText = $$""" | |
| { | |
| "localizedLastName": "Smith", | |
| "firstName": { "localized": { "en_US": "{{name}}" }, "preferredLocale": { "country": "US", "language": "en" } }, | |
| "lastName": { "localized": { "en_US": "Smith" }, "preferredLocale": { "country": "US", "language": "en" } }, | |
| "id": "123456", | |
| "localizedFirstName": "John" | |
| } | |
| """; | |
| Console.WriteLine(jsonText); |
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
| 🌄 C# 11 Raw String Literal Example | |
| { | |
| "localizedLastName": "Smith", | |
| "firstName": { "localized": { "en_US": "John" }, "preferredLocale": { "country": "US", "language": "en" } }, | |
| "lastName": { "localized": { "en_US": "Smith" }, "preferredLocale": { "country": "US", "language": "en" } }, | |
| "id": "123456", | |
| "localizedFirstName": "John" | |
| } |
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
| { | |
| "version": 1, | |
| "target": "Run", | |
| "mode": "Debug", | |
| "branch": "main" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment