/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System/Console/Overview/csharp/unicode1.cs
36 строк
1 KB
Genevieve Warren
Add remarks for core types (#38970)
05 янв 2024, 22:14
Не верифицирован
05 янв 2024, 22:14
71d1377
Код
Авторство
О чём код?
// <Snippet1> using System; public class Example3 { public static void Main() { // Create a Char array for the modern Cyrillic alphabet, // from U+0410 to U+044F. int nChars = 0x044F - 0x0410 + 1; char[] chars = new char[nChars]; ushort codePoint = 0x0410; for (int ctr = 0; ctr < chars.Length; ctr++) { chars[ctr] = (char)codePoint; codePoint++; } Console.WriteLine("Current code page: {0}\n", Console.OutputEncoding.CodePage); // Display the characters. foreach (var ch in chars) { Console.Write("{0} ", ch); if (Console.CursorLeft >= 70) Console.WriteLine(); } } } // The example displays the following output: // Current code page: 437 // // ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // </Snippet1>