Convert.ToBoolean (UInt16) converts 16-bit unsigned integer to Boolean value.
Class Sample
Public Shared Sub Main()
Dim numbers() As UShort = { UInt16.MinValue, 1, 2010, UInt16.MaxValue }
Dim result As Boolean
For Each number As UShort In numbers
result = Convert.ToBoolean(number)
Console.WriteLine("{0,-7:N0} --> {1}", number, result)
Next
End Sub
End Class
Related examples in the same category