While we do check for invalid path characters a path is not necessarily only invalid because of a character, but the order in which the chars appear. Enter a url like https://google.com for example:) all are valid in a path but :// is not valid together.
I didn't return null as logically if this function is used for anything else returning the input would probably be expected. I do not believe there is a risk of File.Exists or Directory.Exists throwing an exception as long as the string doesn't contain invalid chars (but order invalid is allowed). The few exceptions I tested it seemed those handled it fine so we didn't need to wrap them too.
Closes #148
While we do check for invalid path characters a path is not necessarily only invalid because of a character, but the order in which the chars appear. Enter a url like https://google.com for example:) all are valid in a path but :// is not valid together.
I didn't return null as logically if this function is used for anything else returning the input would probably be expected. I do not believe there is a risk of File.Exists or Directory.Exists throwing an exception as long as the string doesn't contain invalid chars (but order invalid is allowed). The few exceptions I tested it seemed those handled it fine so we didn't need to wrap them too.