• Home
  • API Documentation
Show / Hide Table of Contents
  • Mozzarella
    • ByteArrayExtensions
      • AsString
      • ToHexString
    • CoalesceOptions
      • None
      • WhiteSpaceAsEmpty
    • EnumerableOfStringExtensions
      • Coalesce
    • ErasableString
      • Clear
      • Dispose
      • ErasableString
      • IsCleared
      • IsDisposed
      • Value
    • StringBuilderExtensions
      • Append
      • AppendIf
      • AppendJoin
      • Contains
      • IndexOf
      • LastIndexOf
      • ToLower
      • ToUpper
      • Trim
      • TrimEnd
      • TrimStart
    • StringExtensions
      • AddPrefix
      • AddSuffix
      • AfterFirst
      • AfterLast
      • BeforeFirst
      • BeforeLast
      • CICompare
      • CIContains
      • CIEquals
      • CIReplace
      • Coalesce
      • Contains
      • ContainsOnly
      • IndexOfFirstDifference
      • IsAllDigits
      • IsAlphanumeric
      • IsNullOrEmpty
      • IsNullOrWhiteSpace
      • IsOnlyAlphas
      • IsOnlyDigits
      • LevenshteinDistanceTo
      • Like
      • NullIfEmpty
      • OCICompare
      • OCIContains
      • OCIEquals
      • OCIReplace
      • OEquals
      • PascalCaseToWords
      • RemoveAllExcept
      • RemoveAllWhiteSpace
      • RemoveNonAlphanumerics
      • RemoveNonAlphas
      • Replace
      • StripNonDigits
      • StripPrefix
      • StripSuffix
      • Truncate
  • Mozzarella.Tests
    • RemoveNonAlphanumerics
      • RemoveNonAlphanumerics_DoesNotRemoveNumerics
      • RemoveNonAlphanumerics_RemovesNonAlphanumerics
      • RemoveNonAlphanumerics_ReturnsEmptyForEmpty
      • RemoveNonAlphanumerics_ReturnsNullForNull
      • RemoveNonAlphanumerics_ReturnsOriginalStringWhenNoCharactersRemoved
    • RemoveNonAlphas
      • RemoveNonAlphas_RemovesNonNumericNonAlphas
      • RemoveNonAlphas_RemovesNumerics
      • RemoveNonAlphas_ReturnsEmptyForEmpty
      • RemoveNonAlphas_ReturnsNullForNull
      • RemoveNonAlphas_ReturnsOriginalStringWhenNoCharactersRemoved

Method AppendJoin

AppendJoin(StringBuilder, String, String[])

Appends all the strings in parts to builder placing separator between each part.

Declaration
public static StringBuilder AppendJoin(this StringBuilder builder, string separator, params string[] parts)
Parameters
Type Name Description
System.Text.StringBuilder builder

The System.Text.StringBuilder to append to.

System.String separator

The value to place between each new appended part. If null or empty string, no separator is used.

System.String[] parts

An array of strings to be appended.

Returns
Type Description
System.Text.StringBuilder

A reference to builder, allowing method calls to be chained.

Remarks

If parts is null or zero length, nothing is appended (and no exception is thrown).

If parts contains only a single item then separator is not used.

No separator is placed as the start even if builder is not empty.

If parts contains any null values an empty string is appended instead.

Exceptions
Type Condition
System.ArgumentNullException

Thrown if builder is null.

AppendJoin(StringBuilder, String, IList<String>)

Appends all the strings in parts to builder placing separator between each part.

Declaration
public static StringBuilder AppendJoin(this StringBuilder builder, string separator, IList<string> parts)
Parameters
Type Name Description
System.Text.StringBuilder builder

The System.Text.StringBuilder to append to.

System.String separator

The value to place between each new appended part. If null or empty string, no separator is used.

System.Collections.Generic.IList<System.String> parts

An array of strings to be appended.

Returns
Type Description
System.Text.StringBuilder

A reference to builder, allowing method calls to be chained.

Remarks

If parts is null or contains no items, nothing is appended (and no exception is thrown).

If parts contains only a single item then separator is not used.

No separator is placed as the start even if builder is not empty.

If parts contains any null values an empty string is appended instead.

Exceptions
Type Condition
System.ArgumentNullException

Thrown if builder is null.

AppendJoin(StringBuilder, String, IEnumerable<String>)

Appends all the strings in parts to builder placing separator between each part.

Declaration
public static StringBuilder AppendJoin(this StringBuilder builder, string separator, IEnumerable<string> parts)
Parameters
Type Name Description
System.Text.StringBuilder builder

The System.Text.StringBuilder to append to.

System.String separator

The value to place between each new appended part. If null or empty string, no separator is used.

System.Collections.Generic.IEnumerable<System.String> parts

An array of strings to be appended.

Returns
Type Description
System.Text.StringBuilder

A reference to builder, allowing method calls to be chained.

Remarks

If parts is null or contains no items, nothing is appended (and no exception is thrown).

If parts contains only a single item then separator is not used.

No separator is placed as the start even if builder is not empty.

If parts contains any null values an empty string is appended instead.

Exceptions
Type Condition
System.ArgumentNullException

Thrown if builder is null.

Back to top Copyright (c) 2017 Troy Willmot