/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System/FormatException/Overview/csharp/qa-interpolated1.cs
23 строки
866 B
Genevieve Warren
Move member remarks (#39270)
30 янв 2024, 00:43
Не верифицирован
30 янв 2024, 00:43
6c88824
Код
Авторство
О чём код?
using System; public class Example12 { public static void Main() { // <SnippetQAInterpolated> string[] names = { "Balto", "Vanya", "Dakota", "Samuel", "Koani", "Yiska", "Yuma" }; string output = names[0] + ", " + names[1] + ", " + names[2] + ", " + names[3] + ", " + names[4] + ", " + names[5] + ", " + names[6]; output += "\n"; var date = DateTime.Now; output += String.Format("It is {0:t} on {0:d}. The day of the week is {1}.", date, date.DayOfWeek); Console.WriteLine(output); // The example displays the following output: // Balto, Vanya, Dakota, Samuel, Koani, Yiska, Yuma // It is 10:29 AM on 1/8/2018. The day of the week is Monday. // </SnippetQAInterpolated> } }