NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

String.Remove

Deletes a specified number of characters from this String beginning at a specified location.

[Visual Basic]
Public Function Remove( _
   ByVal startIndex As Integer, _
   ByVal count As Integer _
) As String
[C#]
public string Remove(
   int startIndex,
   int count
);
[C++]
public: String* Remove(
   int startIndex,
   int count
);
[JScript]
public function Remove(
   startIndex : int,
   count : int
) : String;

Parameters

startIndex
The position to begin in the part of string to be deleted.
count
The number of characters to be deleted in the string.

Return Value

A string that consists of the number of characters removed from this instance starting at beginning point.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException If either the index or the number of characters is less than zero.
ArgumentOutOfRangeException If the index and the number of characters are greater than the length of this string.

Remarks

The Remove method updates a string by removing trailing characters. The string is unchanged. As a special case, if the beginning position is equal to the length of this string and if the number of characters is zero, then a copy of this string is returned.

Note that the first location has an index of 0.

The startIndex parameter must be greater than 0 or equal to the length of this string.

The count parameter can be zero, in which case no characters are removed.

See Also

String Class | String Members | System Namespace