Powershell‎ > ‎

strings




-split vs .split()

-split will split on a string
.spliit() defaults to split by character but you can change this like the example below

$delim = [string[]]@(" Error: ")
$string.split($delim, [System.StringSplitOptions]::None)
$string.split($delim, [System.StringSplitOptions]::RemoveEmptyEntries)








Comments