This String helper class enables in-place
modification of a string without
having to create new string instances. Since strings are immutable,
their values cannot change once set. (Attempts to assign a new value
to an existing string succeed, but at the expense of destroying and
re-creating the original string.) The
StringBuilder constructor allows you to set the
size of the StringBuilder and specify the initial
string it contains. The Insert( ) methods put new
data (of varying types) into the StringBuilder at
a specified position. Append( ) adds data to the
end of a StringBuilder. The ToString(
) method converts the StringBuilder into
a real string.
public sealed class StringBuilder {
// Public Constructors
public StringBuilder( );
public StringBuilder(int capacity);
public StringBuilder(int capacity, int maxCapacity);
public StringBuilder(string value);
public StringBuilder(string value, int capacity);
public StringBuilder(string value, int startIndex, int length, int capacity);
// Public Instance Properties
public int Capacity{set; get; }
public int Length{set; get; }
public int MaxCapacity{get; }
public char this[int index]{set; get; }
// Public Instance Methods
public StringBuilder Append(bool value);
public StringBuilder Append(byte value);
public StringBuilder Append(char value);
public StringBuilder Append(char[ ] value);
public StringBuilder Append(char[ ] value, int startIndex, int charCount);
public StringBuilder Append(char value, int repeatCount);
public StringBuilder Append(decimal value);
public StringBuilder Append(double value);
public StringBuilder Append(short value);
public StringBuilder Append(int value);
public StringBuilder Append(long value);
public StringBuilder Append(object value);
public StringBuilder Append(sbyte value);
public StringBuilder Append(float value);
public StringBuilder Append(string value);
public StringBuilder Append(string value, int startIndex, int count);
public StringBuilder Append(ushort value);
public StringBuilder Append(uint value);
public StringBuilder Append(ulong value);
public StringBuilder AppendFormat(IFormatProvider provider, string format, params object[ ] args);
public StringBuilder AppendFormat(string format, object arg0);
public StringBuilder AppendFormat(string format,
params object[ ] args);
public StringBuilder AppendFormat(string format, object arg0, object arg1);
public StringBuilder AppendFormat(string format, object arg0, object arg1, object arg2);
public int EnsureCapacity(int capacity);
public bool Equals(StringBuilder sb);
public StringBuilder Insert(int index, bool value);
public StringBuilder Insert(int index, byte value);
public StringBuilder Insert(int index, char value);
public StringBuilder Insert(int index, char[ ] value);
public StringBuilder Insert(int index, char[ ] value, int startIndex, int charCount);
public StringBuilder Insert(int index, decimal value);
public StringBuilder Insert(int index, double value);
public StringBuilder Insert(int index, short value);
public StringBuilder Insert(int index, int value);
public StringBuilder Insert(int index, long value);
public StringBuilder Insert(int index, object value);
public StringBuilder Insert(int index, sbyte value);
public StringBuilder Insert(int index, float value);
public StringBuilder Insert(int index, string value);
public StringBuilder Insert(int index, string value, int count);
public StringBuilder Insert(int index, ushort value);
public StringBuilder Insert(int index, uint value);
public StringBuilder Insert(int index, ulong value);
public StringBuilder Remove(int startIndex, int length);
public StringBuilder Replace(char oldChar, char newChar);
public StringBuilder Replace(char oldChar, char newChar, int startIndex, int count);
public StringBuilder Replace(string oldValue, string newValue);
public StringBuilder Replace(string oldValue, string newValue, int startIndex, int count);
public override string ToString( );
// overrides object
public string ToString(int startIndex, int length);
}