UnicodeEncoding.CharSize Pole

Definicja

Reprezentuje rozmiar znaków Unicode w bajtach. To pole jest stałą.

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

Wartość pola

Value = 2

Przykłady

W poniższym przykładzie pokazano, jak zwrócić wartość CharSize i wyświetlić ją.

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

Uwagi

Wartość tego pola jest 32-bitową stałą ze znakiem o wartości 2.

Dotyczy