string class : SubString(int) method

Description

Gets a new instance of the string that is from the position that specified by the index to the end of the invoker string.

Syntax

stringINstance.SubString(int startPosition)

Arguments

ClassNameDescription
intstartPositionStarting position of the search.

Return value

ClassDescription
stringA new instance of the string that is from the position that specified by the index to the end of the invoker string.

Sample code

//anyString is a instance of string type.

string subString = anyString.SubString(5);

Notes

It's a wrapper of the System.Globalization.StringInfo.SubstringByTextElements(Int32).

The index is zero-based.

Links for reference

Copyright © Rice All rights reserved.