The substring() method will take the string value from Build.SourceVersion
and can be passed two int
parameters. One will output the string value starting at a specific character position, and the other tell it what subsequent character positions characters to output.
$a = "0gc58d92d905d62415b8866g3f48f17416da426s"
$a.substring(0,7)
Output
0gc58d9
Pass the substring() method just one int
parameter telling it the starting character position to just output all subsequent character position characters until the end of the string.
$a = "0gc58d92d905d62415b8866g3f48f17416da426s"
$a.substring(8)
Output
d905d62415b8866g3f48f17416da426s
Supporting Resource
Substring()
String.Substring Method
Substring(Int32)
- Retrieves a substring from this instance. The substring starts at a specified character position and continues to the end of the string.
Substring(Int32, Int32)
- Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.