Simply awesomeThe #1 ASP/ASP.NET Developer Community

StringBuilder.Remove Method

System.Text Namespace   StringBuilder Class


Removes the specified range of characters from this instance.

[ VB ]
<Serializable>
Public Function Remove ( _
   ByVal startIndex As Integer, _
   ByVal length As Integer _
) As StringBuilder

[ C# ]
[Serializable]
public StringBuilder Remove ( 
   int startIndex,
   int length
);

[ C++ ]
[Serializable]
public: StringBuilder* Remove ( 
   int startIndex,
   int length
);

[ JScript ]
public Serializable
function Remove ( 
   startIndex : int,
   length : int
) : StringBuilder;

Parameters

startIndex
The position where removal begins.
length
The number of characters to remove.

Return Value

A reference to this instance after the excise operation has occurred.

Exceptions


Exception Type Condition
ArgumentOutOfRangeException If startIndex or length is less than zero, or startIndex + length is greater than the length of this instance.

Remarks

The current method removes the specified range of characters from the current instance. The characters at ( startIndex + length ) are moved to startIndex, and the string value of the current instance is shortened by length. The capacity is unaffected.

Replace ( string oldValue,

null ) can be used to remove all instances of a string from a StringBuilder.

See Also

StringBuilder Members


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note