Print Console C#

How to print console to the output as string?

Use StringBuilder to build your output string.

StringBuilder sb = new StringBuilder();

// add stuff to sb with Append or AppendLine

Print(sb.ToString());