Click or drag to resize
StringRemove Method (Int32, Int32)
Returns a new string in which a specified number of characters in this instance beginning at a specified position have been deleted.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public string Remove(
	int startIndex,
	int count
)

Parameters

startIndex
Type: SystemInt32
The zero-based position to begin deleting characters.
count
Type: SystemInt32
The number of characters to delete.

Return Value

Type: String
A new string that is equivalent to this instance except for the removed characters.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionEither startIndex or count is less than zero.-or- startIndex plus count specify a position outside this instance.
See Also