A spin-off question from another SO question.
When splitting a here-string on carridge return + line feed [backtick]r[backtick]n I would expect the following results
$theString = @"
word
word
word
word
word
"@
$theString.Split("`r`n") | Measure-Object
Count : 5
Average :
Sum :
Maximum :
Minimum :
Property :
Instead what I get is the following output
Count : 9
Average :
Sum :
Maximum :
Minimum :
Property :
The extra 4 object are empty strings. Running %{ $_.GetType().FullName} shows all items of type System.String. In the aforementioned SO Question the answers account for the empty strings. I am trying to understand why they are created from the split when I wouldnt expect them to be.