I started using C# Interactive and like the fact that I can browse and explore some API functionalities like I do with Immediate
without the need to run and debug my program.
The problem is that it does not output the info like Immediate does unless I do a command with a variable name:
> string.Format("{0,15}", 10m); //hit enter, here there is no output > var a = string.Format("{0,15}", 10m); //hit enter so... > a // hit enter and... " 10" //...here the value is shown >
Is there a way to make C# Interactive
output the values in every evaluation like Immediate
does (And without write more code for that like Console.Write
)?
Yes, to output the result of an evaluated expression simply do not put a semicolon at the end. In your example, instead of this:
string.Format("{0,15}", 10m);
do this:
string.Format("{0,15}", 10m)
See the documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With