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