BoolToYes bool(?)

.BoolToYes()

Converts bool or bool? to "Yes" if true or "" if false or null.

Method

public static string BoolToYes(this bool val)
public static string BoolToYes(this bool? val)
bool(?) val

The bool value to test for true.

Example

C#
bool b = true;
string text = b.BoolToYes();