Share via


Remove Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Removes the specified range of characters from this instance.

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Function Remove ( _
    startIndex As Integer, _
    length As Integer _
) As StringBuilder
public StringBuilder Remove(
    int startIndex,
    int length
)
public:
StringBuilder^ Remove(
    int startIndex, 
    int length
)
member Remove : 
        startIndex:int * 
        length:int -> StringBuilder 
public function Remove(
    startIndex : int, 
    length : int
) : StringBuilder

Parameters

Return Value

Type: System.Text. . :: . .StringBuilder
A reference to this instance after the excise operation has completed.

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 of the current instance is unaffected.

Note

The Remove method modifies the value of the current StringBuilder instance and returns that instance. It does not create and return a new StringBuilder object.

.NET Framework Security

See Also

Reference

StringBuilder Class

System.Text Namespace