MoaidHathot / Dumpify

Adding `.Dump()` extension methods to Console Applications, similar to LinqPad's.
MIT License
959 stars 40 forks source link

Support for generating simple string without double-quotes #19

Closed rorourke-iot closed 8 months ago

rorourke-iot commented 8 months ago

Some sort of configuration option to eliminate double-quotes for simple string output.

"This value".Dump()

to look like

This value

instead of

"This value"

MoaidHathot commented 8 months ago

Hi @rorourke-iot, I'll add an option (configuration) for settings this to all dumps globally and perhaps for each dump. Will that suffice?

rorourke-iot commented 8 months ago

That should do it. Thanks.

MoaidHathot commented 8 months ago

Hi @rorourke-iot, I've added the following configuration as part of commit bef63bc587634862072859c986100c569819fc20, which will be part of the next release this week.

    DumpConfig.Default.TypeRenderingConfig.QuoteStringValues= false;
    DumpConfig.Default.TypeRenderingConfig.StringQuotationChar = '`';

    //or

    "Hello".Dump("per dump", typeRenderingConfig: new TypeRenderingConfig { QuoteStringValues = false, StringQuotationChar = '`'});

The following are the default value used:

    DumpConfig.Default.TypeRenderingConfig.QuoteStringValues= true;
    DumpConfig.Default.TypeRenderingConfig.StringQuotationChar = '"';
MoaidHathot commented 8 months ago

This is part of release 0.6.2, now available