Split string into an array on spaces
$string = "The quick brown fox jumps over the lazy dog." $string.split()
Exclude blanks when splitting a string into an array
$option = [System.StringSplitOptions]::RemoveEmptyEntries $string.split(";",$option)
Get all Text after a character
$string = "1. Computer name:DC-G11-FTW.contoso.com" $string.Substring($string.IndexOf(":")+1,$string.length-$string.IndexOf(":")-1)
Get all Text before a character
$string = "[email protected]" $string.Substring(0,$string.IndexOf("@"))