I have an application that is implementing its own C# console (via Roslyn's scripting engine). I already got the code to execute a statement and got the possible return value and now I would like to output a "nice" string to the console. The trivial approach to call "ToString()" will usually have very human unreadable output.
The best solution for me would be to have the same kind of inspection output that the "Immediate Window" of Visual Studio uses.
So for example if my statement evaluates to a new string[]{"asd"}, then just calling ToString() would give me
System.String[]
where I would like to have the equivalent output of the Immediate Window - something like this:
{string[1]}
[0]: "asd"
So does anyone knows how to call the same convertion that the Immediate Window uses?