System.String.Remove Method

Returns a new string in which all the characters in the current instance, beginning at a specified position and continuing through the last position, have been deleted.

Syntax

public string Remove (int startIndex)

Parameters

startIndex
The zero-based position to begin deleting characters.

Returns

A new string that is equivalent to this string except for the removed characters.

Remarks

In the dnprdnshort, strings are zero-based. The value of the startIndex parameter can range from zero to one less than the length of the string instance.

Note:

This method does not modify the value of the current instance. Instead, it returns a new string in which all characters from position startIndex to the end of the original string have been removed.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0