Powershell Tip #116: Remove empty elements from an array By powershellgu | September 10, 2016 0 Comment 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)