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
Class | Name | Description |
int | startPosition | A start position of removing. |
int | number | A number of characters that is removed. |
Return value
Class | Description |
string | A 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