UnicodeEncoding.CharSize フィールド

定義

Unicode 文字サイズをバイト単位で表します。 このフィールドは定数です。

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

フィールド値

Value = 2

次の例では、 の CharSize 値を返して表示する方法を示します。

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

注釈

このフィールドの値は、値が 2 の 32 ビット符号付き定数です。

適用対象