• 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

Class StringBuilderExtensions

Extension methods for System.Text.StringBuilder.

Inheritance
System.Object
StringBuilderExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mozzarella
Assembly: cs.temp.dll.dll
Syntax
public static class StringBuilderExtensions

Methods

Name Description
Append(StringBuilder, String, String)

If builder is not empty, appends separator then value. If builder is empty, appends only value.

AppendIf(StringBuilder, Boolean, Func<String>)

Appends the result of valueFactory only if condition is true, otherwise does nothing.

AppendIf(StringBuilder, Boolean, String)

Appends value only if condition is true, otherwise does nothing.

AppendJoin(StringBuilder, String, IEnumerable<String>)

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

AppendJoin(StringBuilder, String, IList<String>)

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

AppendJoin(StringBuilder, String, String[])

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

Contains(StringBuilder, String)

Returns true if builder contains searchValue.

IndexOf(StringBuilder, String)

Returns the ordinal position of the start of searchValue within searchValue.

IndexOf(StringBuilder, String, Int32)

Returns the ordinal position of the start of searchValue within searchValue.

LastIndexOf(StringBuilder, String)

Returns the last ordinal position of the start of searchValue within searchValue.

LastIndexOf(StringBuilder, String, Int32)

Returns the last ordinal position of the start of searchValue within searchValue.

ToLower(StringBuilder)

Ensures/converts the entire contents of the builder to lowercase characters.

ToLower(StringBuilder, CultureInfo)

Ensures/converts the entire contents of the builder to lowercase characters.

ToUpper(StringBuilder)

Ensures/converts the entire contents of the builder to uppercase characters.

ToUpper(StringBuilder, CultureInfo)

Ensures/converts the entire contents of the builder to uppercase characters.

Trim(StringBuilder)

Removes all leading and trailing whitespace from builder.

Trim(StringBuilder, Char[])

Removes all leading and trailing characters in builder that exist within trimChars.

TrimEnd(StringBuilder)

Removes all trailing whitespace from builder.

TrimEnd(StringBuilder, Char[])

Removes all trailing characters in builder that exist within trimChars.

TrimStart(StringBuilder)

Removes all leading whitespace from builder.

TrimStart(StringBuilder, Char[])

Removes all leading characters in builder that exist within trimChars.

Back to top Copyright (c) 2017 Troy Willmot