Redirecting console to a string in a .NET program
c#, console, string
Solution
For your own process, `Console.SetOut` and redirect it to a TextWriter built on top of a string builder or memory stream. For a launched child process, use `ProcessStartInfo.RedirectStandardOutput` when launching the process.
Problem
How can I redirect whatever is written to the console to be written into a string?