CSharp examples for System:Boolean
Transform the meaning of boolean value in integer value
using System.Web; using System.Web.UI.WebControls; using System.Collections; using System.Text; using System;//w ww . ja v a2 s .c o m public class Main{ /// <summary> /// Transform the meaning of boolean value in integer value /// </summary> /// <param name="value">true/false value to be transformed</param> /// <returns>1 if the value is true, 0 if the value is false</returns> private static int boolToNum(bool value) { return value ? 1 : 0; } }