C# Convert ToUInt16(Byte)
Description
Convert ToUInt16(Byte)
converts the value of the specified
8-bit unsigned integer to the equivalent 16-bit unsigned integer.
Syntax
Convert.ToUInt16(Byte)
has the following syntax.
[CLSCompliantAttribute(false)]
public static ushort ToUInt16(
byte value
)
Parameters
Convert.ToUInt16(Byte)
has the following parameters.
value
- The 8-bit unsigned integer to convert.
Returns
Convert.ToUInt16(Byte)
method returns A 16-bit unsigned integer that is equivalent to value.
Example
/* www. jav a 2s . c o m*/
using System;
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(Convert.ToUInt16((byte)123));
}
}
The code above generates the following result.