class StringBuilder
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.
capacityThe 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.
capacityThe suggested starting size of the .maxCapacityThe maximum number of characters the current string can contain.
public StringBuilder( string value )
Initializes a new instance of the class using the specified string.
valueThe 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.
valueThe string used to initialize the value of the instance. If is , the new will contain the empty string (that is, it contains ).capacityThe 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.
valueThe 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 ).startIndexThe position within where the substring begins.lengthThe number of characters in the substring.capacityThe suggested starting size of the .
public StringBuilder Append( bool value )
Appends the string representation of a specified Boolean value to this instance.
valueThe 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.
valueThe 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.
valueThe 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.
valueA pointer to an array of characters.valueCountThe 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.
valueThe character to append.repeatCountThe 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.
valueThe 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.
valueA character array.startIndexThe starting position in .charCountThe 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.
valueThe 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.
valueThe 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.
valueThe 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.
valueThe 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.
valueThe 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.
valueThe 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.
valueThe 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.
valueThe 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.
valueThe 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.
valueThe string that contains the substring to append.startIndexThe starting position of the substring within .countThe 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.
valueThe 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.
valueThe string builder that contains the substring to append.startIndexThe starting position of the substring within .countThe 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.
valueThe 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.
valueThe 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.
valueThe 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.
providerAn object that supplies culture-specific formatting information.formatA composite format string.arg0The 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.
providerAn object that supplies culture-specific formatting information.formatA composite format string.arg0The first object to format.arg1The 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.
providerAn object that supplies culture-specific formatting information.formatA composite format string.arg0The first object to format.arg1The second object to format.arg2The 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.
providerAn object that supplies culture-specific formatting information.formatA composite format string.argsAn 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.
formatA composite format string.arg0An 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.
formatA composite format string.arg0The first object to format.arg1The 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.
formatA composite format string.arg0The first object to format.arg1The second object to format.arg2The 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.
formatA composite format string.argsAn 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.
valueThe 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.
sourceIndexThe starting position in this instance where characters will be copied from. The index is zero-based.destinationThe array where characters will be copied.destinationIndexThe starting position in where characters will be copied. The index is zero-based.countThe 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.
capacityThe 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.
sbAn 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueA character array.startIndexThe starting index within .charCountThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe string to insert.countThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
indexThe position in this instance where insertion begins.valueThe 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.
startIndexThe zero-based position in this instance where removal begins.lengthThe 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.
oldCharThe character to replace.newCharThe 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.
oldCharThe character to replace.newCharThe character that replaces .startIndexThe position in this instance where the substring begins.countThe 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.
oldValueThe string to replace.newValueThe 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.
oldValueThe string to replace.newValueThe string that replaces , or .startIndexThe position in this instance where the substring begins.countThe 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 .
startIndexThe starting position of the substring in this instance.lengthThe 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.