Powershell Tip #116: Remove empty elements from an array By powershellgu | September 10, 2016 3 Comments Tip: You can remove empty elements in an array. PowerShell # Solution 1 $array.Where({ $_ -ne "" }) # Solution 2 $array | Where-Object {$_} # Solution 3 $array.Split('',[System.StringSplitOptions]::RemoveEmptyEntries) 12345678 # Solution 1$array.Where({ $_ -ne "" }) # Solution 2$array | Where-Object {$_} # Solution 3$array.Split('',[System.StringSplitOptions]::RemoveEmptyEntries)
Pingback: Powershell Tip #115: Create a bunch of files | Powershell Guru
Pingback: Powershell Tip #117: Remove whitespaces from a string | Powershell Guru
G R E A T !!
Thx