more fun with strings

This commit is contained in:
Geir Okkenhaug Jerstad 2024-11-29 13:10:49 +01:00
parent 8d9bff7215
commit 9e1cff95ed

View file

@ -34,7 +34,8 @@
`--{__________) \/ `--{__________) \/
"); ");
Console.WriteLine(@" Console.WriteLine(
@"
@ -95,6 +96,29 @@
\_________________\___\/ \_________________\___\/
End End
"""); """);
string mamaSaid = // Multi-line raw string literal.
"""
Mama said, "Life was just a box of chocolates..."
""";
string jsonDialogue = $$"""
{
"quote": {
"character": "The MAN",
"dialogue": ""
},
"description": "She nods, not much interested. He...",
"quote": {
"character": "The MAN",
"dialogue": ""
},
"description": "She shakes \"no\" He unwraps it...",
"quote": {
"character": "The MAN",
"dialogue": "{{mamaSaid.Replace("\"", "\\\"")}}"
}
}
""";
Console.WriteLine(jsonDialogue);
} }
} }
} }