System.BitConverter.GetBytes Method

Returns the specified Unicode character value as an array of bytes.

Syntax

public static byte[] GetBytes (char value)

Parameters

value
A character to convert.

Returns

An array of bytes with length 2.

Remarks

The order of bytes in the array returned by the BitConverter.GetBytes(bool) method depends on whether the computer architecture is little-endian or big-endian.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0