class StringBuilder

in global :: System . Text

Represents a mutable string of characters. This class cannot be inherited.


public StringBuilder( int capacity )

Initializes a new instance of the class using the specified capacity.

  • capacity The suggested starting size of this instance.

public StringBuilder( int capacity, int maxCapacity )

Initializes a new instance of the class that starts with a specified capacity and can grow to a specified maximum.

  • capacity The suggested starting size of the .
  • maxCapacity The maximum number of characters the current string can contain.

public StringBuilder( string value )

Initializes a new instance of the class using the specified string.

  • value The string used to initialize the value of the instance. If is , the new will contain the empty string (that is, it contains ).

public StringBuilder( string value, int capacity )

Initializes a new instance of the class using the specified string and capacity.

  • value The string used to initialize the value of the instance. If is , the new will contain the empty string (that is, it contains ).
  • capacity The suggested starting size of the .

public StringBuilder( string value, int startIndex, int length, int capacity )

Initializes a new instance of the class from the specified substring and capacity.

  • value The string that contains the substring used to initialize the value of this instance. If is , the new will contain the empty string (that is, it contains ).
  • startIndex The position within where the substring begins.
  • length The number of characters in the substring.
  • capacity The suggested starting size of the .

public StringBuilder Append( bool value )

Appends the string representation of a specified Boolean value to this instance.

  • value The Boolean value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( byte value )

Appends the string representation of a specified 8-bit unsigned integer to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( char value )

Appends the string representation of a specified object to this instance.

  • value The UTF-16-encoded code unit to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( char* value, int valueCount )

Appends an array of Unicode characters starting at a specified address to this instance.

  • value A pointer to an array of characters.
  • valueCount The number of characters in the array.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( char value, int repeatCount )

Appends a specified number of copies of the string representation of a Unicode character to this instance.

  • value The character to append.
  • repeatCount The number of times to append .
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( char[] value )

Appends the string representation of the Unicode characters in a specified array to this instance.

  • value The array of characters to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( char[] value, int startIndex, int charCount )

Appends the string representation of a specified subarray of Unicode characters to this instance.

  • value A character array.
  • startIndex The starting position in .
  • charCount The number of characters to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( decimal value )

Appends the string representation of a specified decimal number to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( double value )

Appends the string representation of a specified double-precision floating-point number to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( short value )

Appends the string representation of a specified 16-bit signed integer to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( int value )

Appends the string representation of a specified 32-bit signed integer to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( long value )

Appends the string representation of a specified 64-bit signed integer to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( object value )

Appends the string representation of a specified object to this instance.

  • value The object to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( sbyte value )

Appends the string representation of a specified 8-bit signed integer to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( float value )

Appends the string representation of a specified single-precision floating-point number to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( string value )

Appends a copy of the specified string to this instance.

  • value The string to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( string value, int startIndex, int count )

Appends a copy of a specified substring to this instance.

  • value The string that contains the substring to append.
  • startIndex The starting position of the substring within .
  • count The number of characters in to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( StringBuilder value )

Appends the string representation of a specified string builder to this instance.

  • value The string builder to append.
  • Returns A reference to this instance after the append operation is completed.

public StringBuilder Append( StringBuilder value, int startIndex, int count )

Appends a copy of a substring within a specified string builder to this instance.

  • value The string builder that contains the substring to append.
  • startIndex The starting position of the substring within .
  • count The number of characters in to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( ushort value )

Appends the string representation of a specified 16-bit unsigned integer to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( uint value )

Appends the string representation of a specified 32-bit unsigned integer to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder Append( ulong value )

Appends the string representation of a specified 64-bit unsigned integer to this instance.

  • value The value to append.
  • Returns A reference to this instance after the append operation has completed.

public StringBuilder AppendFormat( IFormatProvider provider, string format, object arg0 )

Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a single argument using a specified format provider.

  • provider An object that supplies culture-specific formatting information.
  • format A composite format string.
  • arg0 The object to format.
  • Returns A reference to this instance after the append operation has completed. After the append operation, this instance contains any data that existed before the operation, suffixed by a copy of in which any format specification is replaced by the string representation of .

public StringBuilder AppendFormat( IFormatProvider provider, string format, object arg0, object arg1 )

Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of either of two arguments using a specified format provider.

  • provider An object that supplies culture-specific formatting information.
  • format A composite format string.
  • arg0 The first object to format.
  • arg1 The second object to format.
  • Returns A reference to this instance after the append operation has completed. After the append operation, this instance contains any data that existed before the operation, suffixed by a copy of where any format specification is replaced by the string representation of the corresponding object argument.

public StringBuilder AppendFormat( IFormatProvider provider, string format, object arg0, object arg1, object arg2 )

Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of either of three arguments using a specified format provider.

  • provider An object that supplies culture-specific formatting information.
  • format A composite format string.
  • arg0 The first object to format.
  • arg1 The second object to format.
  • arg2 The third object to format.
  • Returns A reference to this instance after the append operation has completed. After the append operation, this instance contains any data that existed before the operation, suffixed by a copy of where any format specification is replaced by the string representation of the corresponding object argument.

public StringBuilder AppendFormat( IFormatProvider provider, string format, object[] args )

Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a corresponding argument in a parameter array using a specified format provider.

  • provider An object that supplies culture-specific formatting information.
  • format A composite format string.
  • args An array of objects to format.
  • Returns A reference to this instance after the append operation has completed. After the append operation, this instance contains any data that existed before the operation, suffixed by a copy of where any format specification is replaced by the string representation of the corresponding object argument.

public StringBuilder AppendFormat( string format, object arg0 )

Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a single argument.

  • format A composite format string.
  • arg0 An object to format.
  • Returns A reference to this instance with appended. Each format item in is replaced by the string representation of .

public StringBuilder AppendFormat( string format, object arg0, object arg1 )

Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of either of two arguments.

  • format A composite format string.
  • arg0 The first object to format.
  • arg1 The second object to format.
  • Returns A reference to this instance with appended. Each format item in is replaced by the string representation of the corresponding object argument.

public StringBuilder AppendFormat( string format, object arg0, object arg1, object arg2 )

Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of either of three arguments.

  • format A composite format string.
  • arg0 The first object to format.
  • arg1 The second object to format.
  • arg2 The third object to format.
  • Returns A reference to this instance with appended. Each format item in is replaced by the string representation of the corresponding object argument.

public StringBuilder AppendFormat( string format, object[] args )

Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a corresponding argument in a parameter array.

  • format A composite format string.
  • args An array of objects to format.
  • Returns A reference to this instance with appended. Each format item in is replaced by the string representation of the corresponding object argument.

public StringBuilder AppendJoin( char separator, object[] values )

No summary.

public StringBuilder AppendJoin( char separator, string[] values )

No summary.

public StringBuilder AppendJoin( string separator, object[] values )

No summary.

public StringBuilder AppendJoin( string separator, string[] values )

No summary.

public StringBuilder AppendLine( string value )

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

  • value The string to append.
  • Returns A reference to this instance after the append operation has completed.

public int Capacity { get; set; }

Gets or sets the maximum number of characters that can be contained in the memory allocated by the current instance.

  • Returns The maximum number of characters that can be contained in the memory allocated by the current instance. Its value can range from to .

public void CopyTo( int sourceIndex, char[] destination, int destinationIndex, int count )

Copies the characters from a specified segment of this instance to a specified segment of a destination array.

  • sourceIndex The starting position in this instance where characters will be copied from. The index is zero-based.
  • destination The array where characters will be copied.
  • destinationIndex The starting position in where characters will be copied. The index is zero-based.
  • count The number of characters to be copied.

public int EnsureCapacity( int capacity )

Ensures that the capacity of this instance of is at least the specified value.

  • capacity The minimum capacity to ensure.
  • Returns The new capacity of this instance.

public bool Equals( StringBuilder sb )

Returns a value indicating whether this instance is equal to a specified object.

  • sb An object to compare with this instance, or .
  • Returns if this instance and have equal string, , and values; otherwise, .

public StringBuilder Insert( int index, bool value )

Inserts the string representation of a Boolean value into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, byte value )

Inserts the string representation of a specified 8-bit unsigned integer into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, char value )

Inserts the string representation of a specified Unicode character into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, char[] value )

Inserts the string representation of a specified array of Unicode characters into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The character array to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, char[] value, int startIndex, int charCount )

Inserts the string representation of a specified subarray of Unicode characters into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value A character array.
  • startIndex The starting index within .
  • charCount The number of characters to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, decimal value )

Inserts the string representation of a decimal number into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, double value )

Inserts the string representation of a double-precision floating-point number into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, short value )

Inserts the string representation of a specified 16-bit signed integer into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, int value )

Inserts the string representation of a specified 32-bit signed integer into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, long value )

Inserts the string representation of a 64-bit signed integer into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, object value )

Inserts the string representation of an object into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The object to insert, or .
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, sbyte value )

Inserts the string representation of a specified 8-bit signed integer into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, float value )

Inserts the string representation of a single-precision floating point number into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, string value )

Inserts a string into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The string to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, string value, int count )

Inserts one or more copies of a specified string into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The string to insert.
  • count The number of times to insert .
  • Returns A reference to this instance after insertion has completed.

public StringBuilder Insert( int index, ushort value )

Inserts the string representation of a 16-bit unsigned integer into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, uint value )

Inserts the string representation of a 32-bit unsigned integer into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public StringBuilder Insert( int index, ulong value )

Inserts the string representation of a 64-bit unsigned integer into this instance at the specified character position.

  • index The position in this instance where insertion begins.
  • value The value to insert.
  • Returns A reference to this instance after the insert operation has completed.

public int Length { get; set; }

Gets or sets the length of the current object.

  • Returns The length of this instance.

public int MaxCapacity { get; }

Gets the maximum capacity of this instance.

  • Returns The maximum number of characters this instance can hold.

public StringBuilder Remove( int startIndex, int length )

Removes the specified range of characters from this instance.

  • startIndex The zero-based position in this instance where removal begins.
  • length The number of characters to remove.
  • Returns A reference to this instance after the excise operation has completed.

public StringBuilder Replace( char oldChar, char newChar )

Replaces all occurrences of a specified character in this instance with another specified character.

  • oldChar The character to replace.
  • newChar The character that replaces .
  • Returns A reference to this instance with replaced by .

public StringBuilder Replace( char oldChar, char newChar, int startIndex, int count )

Replaces, within a substring of this instance, all occurrences of a specified character with another specified character.

  • oldChar The character to replace.
  • newChar The character that replaces .
  • startIndex The position in this instance where the substring begins.
  • count The length of the substring.
  • Returns A reference to this instance with replaced by in the range from to + -1.

public StringBuilder Replace( string oldValue, string newValue )

Replaces all occurrences of a specified string in this instance with another specified string.

  • oldValue The string to replace.
  • newValue The string that replaces , or .
  • Returns A reference to this instance with all instances of replaced by .

public StringBuilder Replace( string oldValue, string newValue, int startIndex, int count )

Replaces, within a substring of this instance, all occurrences of a specified string with another specified string.

  • oldValue The string to replace.
  • newValue The string that replaces , or .
  • startIndex The position in this instance where the substring begins.
  • count The length of the substring.
  • Returns A reference to this instance with all instances of replaced by in the range from to + - 1.

public string ToString( int startIndex, int length )

Converts the value of a substring of this instance to a .

  • startIndex The starting position of the substring in this instance.
  • length The length of the substring.
  • Returns A string whose value is the same as the specified substring of this instance.

public StringBuilder Replace( ReadOnlySpan<char> oldValue, ReadOnlySpan<char> newValue )

😔 No documentation found.

public bool Equals( ReadOnlySpan<char> span )

😔 No documentation found.

public StringBuilder AppendFormat( IFormatProvider provider, CompositeFormat format, ReadOnlySpan<object> args )

😔 No documentation found.

public StringBuilder AppendFormat( IFormatProvider provider, CompositeFormat format, TArg0 arg0, TArg1 arg1, TArg2 arg2 )

😔 No documentation found.

public StringBuilder AppendFormat( IFormatProvider provider, CompositeFormat format, object[] args )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public bool Equals( object obj )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public StringBuilder( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public StringBuilder Replace( ReadOnlySpan<char> oldValue, ReadOnlySpan<char> newValue, int startIndex, int count )

😔 No documentation found.

public StringBuilder AppendJoin( char separator, ReadOnlySpan<string> values )

😔 No documentation found.

public void CopyTo( int sourceIndex, Span<char> destination, int count )

😔 No documentation found.

public StringBuilder AppendLine( IFormatProvider provider, ref StringBuilder.AppendInterpolatedStringHandler handler )

😔 No documentation found.

public StringBuilder Append( IFormatProvider provider, ref StringBuilder.AppendInterpolatedStringHandler handler )

😔 No documentation found.

public StringBuilder AppendJoin( string separator, ReadOnlySpan<object> values )

😔 No documentation found.

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

😔 No documentation found.

public StringBuilder Append( ref StringBuilder.AppendInterpolatedStringHandler handler )

😔 No documentation found.

public StringBuilder AppendJoin( string separator, ReadOnlySpan<string> values )

😔 No documentation found.

public StringBuilder Append( ReadOnlyMemory<char> value )

😔 No documentation found.

public StringBuilder AppendJoin( char separator, ReadOnlySpan<object> values )

😔 No documentation found.

public StringBuilder AppendJoin( char separator, IEnumerable<T> values )

😔 No documentation found.

public StringBuilder Append( ReadOnlySpan<char> value )

😔 No documentation found.

public StringBuilder Insert( int index, ReadOnlySpan<char> value )

😔 No documentation found.

public StringBuilder AppendLine( ref StringBuilder.AppendInterpolatedStringHandler handler )

😔 No documentation found.

public StringBuilder AppendLine( )

😔 No documentation found.

public StringBuilder AppendFormat( string format, ReadOnlySpan<object> args )

😔 No documentation found.

public StringBuilder.ChunkEnumerator GetChunks( )

😔 No documentation found.

public char Chars { get; set; }

😔 No documentation found.

public StringBuilder Clear( )

😔 No documentation found.

public StringBuilder AppendFormat( IFormatProvider provider, string format, ReadOnlySpan<object> args )

😔 No documentation found.

public StringBuilder AppendFormat( IFormatProvider provider, CompositeFormat format, TArg0 arg0, TArg1 arg1 )

😔 No documentation found.

public StringBuilder AppendFormat( IFormatProvider provider, CompositeFormat format, TArg0 arg0 )

😔 No documentation found.