/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/csharp/programming-guide/strings/snippets/VerbatimStringInterpolation.cs
22 строки
746 B
Bill Wagner
Update so the output matches the snippet (#30459)
02 авг 2022, 22:38
Не верифицирован
02 авг 2022, 22:38
0ff3718
Код
Авторство
О чём код?
using System; namespace StringExamples; public static class VerbatimInterpolation { public static void VerbatimInterpolationExample() { // <VerbatimStringInterpolation> var jh = (firstName: "Jupiter", lastName: "Hammon", born: 1711, published: 1761); Console.WriteLine($@"{jh.firstName} {jh.lastName} was an African American poet born in {jh.born}."); Console.WriteLine(@$"He was first published in {jh.published} at the age of {jh.published - jh.born}."); // Output: // Jupiter Hammon // was an African American poet born in 1711. // He was first published in 1761 // at the age of 50. // </VerbatimStringInterpolation> } }