If the string is null, .Split()
will (obviously) throw a NullReferenceException
, like any other instance method.
If the string is empty, .Split()
will return an array of a single empty string (unless you pass StringSplitOptions.RemoveEmptyEntries
).
This is a corner case of its more general (and less unexpected) behavior; if the delimiter does not appear anywhere in the source string, it will return an array containing the entire source string.