I'm checking lines in a given text file. Lines may have random whitespace and I'm only interested in checking the number of words in the line and not the whitespace. I do:
string[] arrParts = strLine.Trim().Split();
if (arrParts.Length > 0)
{
...
}
Now, according to msdn,
If the separator parameter is null or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and return true if they are passed to the Char.IsWhiteSpace method.
The IsWhiteSpace
method covers many diverse forms of whitespace including the usuals: ' ' \t and \n
However recently I've seen this format used:
Split(new char[0], StringSplitOptions.RemoveEmptyEntries)
How is this different?