YesNoBool

.YesNoBool()

Takes a string and converts it to a bool? based on "Yes" == true, "No" == false, null || "" == null.

Method

public static bool? YesNoBool(string val)
string val

The string value to compare to "Yes" for true or null or "" for null. Any other value returns false.

Example

C#
bool? b = "Yes".YesNoBool();