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)

public:
StringBuilder^ Remove(
	int startIndex, 
	int length
)

Parameters

startIndex
Type: System..::..Int32
The zero-based position in this instance where removal begins.
length
Type: System..::..Int32
The number of characters to remove.

Return Value

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

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.

NoteNote

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.

Show: