how to convert a method to bool c# code example Example: convert string to boolean c# bool b = str == "1";