Converts byte to Boolean
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
byte[] bytes = { Byte.MinValue, 100, 200, Byte.MaxValue };
bool result;
foreach (byte byteValue in bytes)
{
result = Convert.ToBoolean(byteValue);
Console.WriteLine("{0,-5} --> {1}", byteValue, result);
}
}
}
Related examples in the same category