Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C#

char: practical reference

char: practical reference: char is a 16-bit UTF-16 code unit, not a complete Unicode character.

Version: C# built-in type reference; .NET 10 runtime

Syntax

char value

char is a 16-bit UTF-16 code unit, not a complete Unicode character.

Use it to process code units; use Rune for scalar values.

A grapheme or a character outside the BMP can occupy multiple char values.

Its default is U+0000, and classification follows Unicode rather than visual appearance.

The complete program actually uses char; its exact expected stdout is System.Char.

Examples

using System;

Console.WriteLine(typeof(char).FullName);

Result

System.Char

The complete program actually uses `char`; its exact expected stdout is `System.Char`.

Sources