拆分字符串后穷缤,消除 string.IsNullOrWhiteSpace
成員
方案1
$splitText = $text.Split('-').Split('', [System.StringSplitOptions]::RemoveEmptyEntries)
方案2
$splitText = $text.Split('-').Where({![string]::IsNullOrWhiteSpace($_)})
拆分字符串后穷缤,消除 string.IsNullOrWhiteSpace
成員
$splitText = $text.Split('-').Split('', [System.StringSplitOptions]::RemoveEmptyEntries)
$splitText = $text.Split('-').Where({![string]::IsNullOrWhiteSpace($_)})