Strings In Depth14 / 16
Up next

The -split operator

$line = "one two   three"
# -split takes a regex; \s+ collapses runs of spaces
$words = $line -split '\s+'
Write-Output $words.Count
What you're solving

split on a regex