PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.Stringifier Class Reference

Provides convenience functions to get reasonable string representations of objects and collections. More...

Static Public Member Functions

static string StringifyCollection< T > (this IEnumerable< T > objs)
 Provides a reasonable human-readable string representation of a collection.
 
static string Stringify (this object obj)
 Provides a reasonable human-readable string representation of an object.
 
static void Dump (this object obj)
 make-shift drop-in for LINQPad's .Dump(), to use, eg, from csharprepl
 
static string Stringify (object obj, string nullRepresentation)
 Provides a reasonable human-readable string representation of an object.
 

Static Public Attributes

const string DEFAULT_NULL_PLACEHOLDER = "null"
 The default value put into a stringified result when null is encountered.
 
const string SEEN_OBJECT_PLACEHOLDER = "(at:"
 The placeholder put into a stringified result when a circular reference is encountered.
 

Detailed Description

Provides convenience functions to get reasonable string representations of objects and collections.

Member Function Documentation

◆ Dump()

static void PeanutButter.Utils.Stringifier.Dump ( this object  obj)
static

make-shift drop-in for LINQPad's .Dump(), to use, eg, from csharprepl

Parameters
obj

◆ Stringify() [1/2]

static string PeanutButter.Utils.Stringifier.Stringify ( object  obj,
string  nullRepresentation 
)
static

Provides a reasonable human-readable string representation of an object.

Parameters
obj
nullRepresentationHow to represent null values - defaults to the string "null"
Returns
Human-readable representation of object

◆ Stringify() [2/2]

static string PeanutButter.Utils.Stringifier.Stringify ( this object  obj)
static

Provides a reasonable human-readable string representation of an object.

Parameters
obj
Returns
Human-readable representation of object

◆ StringifyCollection< T >()

static string PeanutButter.Utils.Stringifier.StringifyCollection< T > ( this IEnumerable< T >  objs)
static

Provides a reasonable human-readable string representation of a collection.

Parameters
objs
Returns
Human-readable representation of collection

The documentation for this class was generated from the following file: