C# Convert ToUInt16(Object)
Description
Convert ToUInt16(Object)
converts the value of the specified
object to a 16-bit unsigned integer.
Syntax
Convert.ToUInt16(Object)
has the following syntax.
[CLSCompliantAttribute(false)]
public static ushort ToUInt16(
Object value
)
Parameters
Convert.ToUInt16(Object)
has the following parameters.
value
- An object that implements the IConvertible interface, or null.
Returns
Convert.ToUInt16(Object)
method returns A 16-bit unsigned integer that is equivalent to value, or zero if value is
null.
Example
//from w ww . jav a 2 s . c om
using System;
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(Convert.ToUInt16((Object)123));
}
}
The code above generates the following result.