string class : Remove(int,int) method

Description

Gets a new instance of the string that have removed the specified number of characters from the specified position.

Syntax

stringInstance.Remove(int startPosition, int number)

Arguments

ClassNameDescription
intstartPositionA start position of removing.
intnumberA number of characters that is removed.

Return value

ClassDescription
stringA new instance of the string that have removed the specified number of characters from the specified position.

Sample code

//anyString is a instance of string type.

string removedString = anyString.Remove(5, 5);

Notes

Position is specified by the index. The index is zero-based.

Links for reference

None

Copyright © Rice All rights reserved.