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;
A reference to this instance after the excise operation has occurred.
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | If startIndex or length is less than zero, or startIndex + length is greater than the length of this instance. |
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.
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