Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Extensions.StringBuilderExtensions Class Reference

StringBuilder custom methods More...

Static Public Member Functions

static bool AppendIf< T > (this StringBuilder sb, T o, bool? condition=null)
 Conditionally appends content to the StringBuilder instance More...
 
static void AppendLineIf< T > (this StringBuilder sb, T o, bool? condition=null)
 Conditionally appends content and a newline to the StringBuilder instance More...
 

Detailed Description

StringBuilder custom methods

Member Function Documentation

◆ AppendIf< T >()

static bool Sphyrnidae.Common.Extensions.StringBuilderExtensions.AppendIf< T > ( this StringBuilder  sb,
o,
bool?  condition = null 
)
static

Conditionally appends content to the StringBuilder instance

Template Parameters
TThe type of object being added
Parameters
sbThe StringBuilder
oThe object being added
conditionThe result of the condition (if null or false, this will not append the object)
Returns
True if the object was appended, false otherwise

◆ AppendLineIf< T >()

static void Sphyrnidae.Common.Extensions.StringBuilderExtensions.AppendLineIf< T > ( this StringBuilder  sb,
o,
bool?  condition = null 
)
static

Conditionally appends content and a newline to the StringBuilder instance

Template Parameters
TThe type of object being added
Parameters
sbThe StringBuilder
oThe object being added
conditionThe result of the condition (if null or false, this will not append the object)

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