Table of Contents

Class StringBuilderExtensions

Namespace
FluentCommand.Extensions
Assembly
FluentCommand.dll

StringBuilder extension methods

public static class StringBuilderExtensions
Inheritance
StringBuilderExtensions
Inherited Members

Methods

AppendIf(StringBuilder, string, bool)

Appends a copy of the specified string if condition is met.

public static StringBuilder AppendIf(this StringBuilder sb, string text, bool condition)

Parameters

sb StringBuilder

The StringBuilder instance to append to.

text string

The string to append.

condition bool

The condition delegate to evaluate. If condition is null, String.IsNullOrWhiteSpace method will be used.

Returns

StringBuilder

AppendIf(StringBuilder, string, Func<string, bool>)

Appends a copy of the specified string if condition is met.

public static StringBuilder AppendIf(this StringBuilder sb, string text, Func<string, bool> condition = null)

Parameters

sb StringBuilder

The StringBuilder instance to append to.

text string

The string to append.

condition Func<string, bool>

The condition delegate to evaluate. If condition is null, String.IsNullOrWhiteSpace method will be used.

Returns

StringBuilder

AppendJoin<T>(StringBuilder, string, IEnumerable<T>)

Concatenates and appends the members of a collection, using the specified separator between each member.

public static StringBuilder AppendJoin<T>(this StringBuilder sb, string separator, IEnumerable<T> values)

Parameters

sb StringBuilder

A reference to this instance after the append operation has completed.

separator string

The string to use as a separator. separator is included in the concatenated and appended strings only if values has more than one element.

values IEnumerable<T>

A collection that contains the objects to concatenate and append to the current instance of the string builder.

Returns

StringBuilder

A reference to this instance after the append operation has completed.

Type Parameters

T

The type of the members of values.

AppendLine(StringBuilder, string, params object[])

Appends a copy of the specified string followed by the default line terminator to the end of the StringBuilder object.

public static StringBuilder AppendLine(this StringBuilder sb, string format, params object[] args)

Parameters

sb StringBuilder

The StringBuilder instance to append to.

format string

A composite format string.

args object[]

An object array that contains zero or more objects to format.

Returns

StringBuilder

AppendLineIf(StringBuilder, Func<bool>)

Appends a copy of the specified string followed by the default line terminator if condition is met.

public static StringBuilder AppendLineIf(this StringBuilder sb, Func<bool> condition)

Parameters

sb StringBuilder

The StringBuilder instance to append to.

condition Func<bool>

The condition delegate to evaluate. If condition is null, String.IsNullOrWhiteSpace method will be used.

Returns

StringBuilder

AppendLineIf(StringBuilder, string, Func<string, bool>)

Appends a copy of the specified string followed by the default line terminator if condition is met.

public static StringBuilder AppendLineIf(this StringBuilder sb, string text, Func<string, bool> condition = null)

Parameters

sb StringBuilder

The StringBuilder instance to append to.

text string

The string to append.

condition Func<string, bool>

The condition delegate to evaluate. If condition is null, String.IsNullOrWhiteSpace method will be used.

Returns

StringBuilder