B bondra Well-known member Joined Oct 24, 2020 Messages 77 Programming Experience Beginner Mar 2, 2021 #1 Is it possible to output a boolean value True/False to say Yes/No instead?
Skydiver Staff member Joined Apr 6, 2019 Messages 7,871 Location Chesapeake, VA Programming Experience 10+ Mar 2, 2021 #2 What wrong with using an extension method ? C#: public static class BooleanExtensions { public static string YesNo(this bool value) => value ? "Yes" : "No"; } : bool iLoveCode = true; Console.WriteLine(iLoveCode.YesNo()); Last edited: Mar 2, 2021 Upvote 0 Downvote
What wrong with using an extension method ? C#: public static class BooleanExtensions { public static string YesNo(this bool value) => value ? "Yes" : "No"; } : bool iLoveCode = true; Console.WriteLine(iLoveCode.YesNo());