Almost daily I come across code of the following form:
string x = "foo" + (someTest ? "bar" : "");
Surely there must be a nicer way to succinctly append a string only if some value is true?
This:
string x = "foo";
if (someTest)
x += "bar";
does not satisfy my appetite, because I often want to use the string directly (e.g. as a function argument), without storing it in a variable.