RSS Feed for This PostCurrent Article

C#: Convert Byte to SByte

Here is a simple way to convert SByte to Byte in C#. E.g. if you want to convert the value of 129 from data type Byte to –127 in SByte

   1: byte byteValue = 129;

   2: sbyte sb = unchecked((sbyte)byteValue);

   3: Console.WriteLine(sb);


Trackback URL


Sorry, comments for this entry are closed at this time.