I get a The path is not of a legal form error when trying to obtain
IO.Path.GetDirectoryName(myString)
... where (in this case) myString is an empty string.
It would be easy to test for an empty string first.
However is there a more comprehensive test against a string, so that this error can be avoided for all kinds of invalid myString?