UnicodeEncoding.CharSize Pole

Definice

Představuje velikost znaku Unicode v bajtech. Toto pole je konstanta.

public: int CharSize = 2;
public const int CharSize = 2;
val mutable CharSize : int
Public Const CharSize As Integer  = 2

Hodnota pole

Value = 2

Příklady

Následující příklad ukazuje, jak vrátit hodnotu CharSize a zobrazit ji.

using namespace System;
using namespace System::Text;
int main()
{
   Console::WriteLine( "Unicode character size: {0} bytes", UnicodeEncoding::CharSize );
}
using System;
using System.Text;

class UnicodeEncodingExample {
    public static void Main() {
        Console.WriteLine(
            "Unicode character size: {0} bytes",
            UnicodeEncoding.CharSize
        );
    }
}
Imports System.Text

Class UnicodeEncodingExample
    
    Public Shared Sub Main()
        Console.WriteLine("Unicode character size: {0} bytes", UnicodeEncoding.CharSize)
    End Sub
End Class

Poznámky

Hodnota tohoto pole je 32bitová signedá konstanta s hodnotou 2.

Platí pro