asp.net.ph

String.Remove Method

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;

Parameters

startIndex
The position in the given String to begin deleting characters.
count
The number of characters to delete.

Return Value

A new String that is equivalent to this instance less count number of characters.

Exceptions


Exception Type Condition
ArgumentOutOfRangeException Either startIndex or count is less than zero.

-or-

startIndex plus count is greater than the length of this instance.


Remarks

For example, the following C# code prints "123456".

String s

= "123abc456";

Response.WriteLine ( s.Remove ( 3, 3 ) );

See Also

String Members   Int32   Concat   Insert   Join   Replace   Split   Substring   Trim Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph