substring

Returns a new string that is a substring of the specified string variable. The substring begins with the character at the specified index and extends to the end of the string, or to the specified ending index.

Syntax:

$[ScriptVariable]::substring(int beginIndex[, int endIndex])

Parameters:

Example:

The following example illustrates the syntax for the substring() string method:

$str = "AAABBBAAA"

$substr = $str::substring(3,6)

print($substr)

Output:

BBB