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: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax 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:
StringA new string that is equivalent to this instance except for the removed characters.
Exceptions Exception | Condition |
---|
ArgumentOutOfRangeException | Either startIndex or count is less than zero.-or- startIndex plus count specify a position outside this instance. |
See Also