System Namespace String Class
Deletes a specified number of characters from this instance beginning at a specified position.
[ VB ]
<Serializable>
Public Function Remove ( _
ByVal startIndex As Integer, _
ByVal count As Integer _
) As String
[ C# ]
[ Serializable ]
public string Remove (
int startIndex,
int count
);
[ C++ ]
[ Serializable ]
public: String* Remove (
int startIndex,
int count
);
[ JScript ]
public Serializable
function Remove (
startIndex : int,
count : int
) : String;
- startIndex
- The position in the given String to begin deleting characters.
- count
- The number of characters to delete.
A new String that is equivalent to this instance less count number of characters.
Exception Type |
Condition |
ArgumentOutOfRangeException |
Either startIndex or count is less than zero.
-or-
startIndex plus count is greater than the length of this instance.
|
For example, the following C# code prints "123456".
String s
= "123abc456";
Response.WriteLine ( s.Remove ( 3, 3 ) );
String Members Int32 Concat Insert Join Replace Split Substring Trim