সিনট্যাক্স
public static bool ToBoolean (byte[] arr, int startIndex);
উপরোক্তে, arr হলো একটি বাইট অ্যারে, আর startIndex হলো ভ্যালুর মধ্যে বাইটের সূচক।
উদাহরণ
using System;
public class Demo {
public static void Main(){
byte[] arr = { 50, 100 };
Console.WriteLine("Array values...");
for (int i = 0; i < arr.Length; i++) {
Console.WriteLine("{0} ", arr[i]);
}
Console.WriteLine("\nConverted values...");
for (int index = 0; index < arr.Length; index++) {
bool res = BitConverter.ToBoolean(arr, index);
Console.WriteLine("" + res);
}
}
}
আউটপুট
Array values... 50 100 Converted values... True True