powerful-football-81694
01/16/2020, 6:13 PMOutput.Format()
if my format string is not a string interpolation inline in code, but instead a composite format string (containing {0}
placeholders) that is fetched from an external source (such as an environment variable)?Input
I suppose I could call String.Format()
inside an .Apply()
on that input.Input
that each correspond to a placeholder in the composite format string.white-balloon-205
01/16/2020, 8:44 PM.Apply
. And if you have multiple inputs .All().Apply()
. Other things (like Output.Format
) are effectively all just sugar for common cases - but if your case falls outside of those - you want .Apply
and maybe .All
.powerful-football-81694
01/16/2020, 8:48 PMtall-librarian-49374
01/16/2020, 8:51 PMvar a = Output.Create("a");
var b = Output.Create("b");
var c = "{0}+{1}";
var d = Output.All<string>(a, b).Apply(vs => string.Format(c, vs.ToArray()));
powerful-football-81694
01/16/2020, 8:52 PM