As far as I can understand, this should be the same algorithm .NET uses to split a command line if it contains quotation marks. It is not so easy to do.
If so, you can download my code which is published on CodeProject and is very well tested. I had to develop this function to be able to test command line parsing effectively without re-starting the test application many times (and actually found and fixed a number of bugs in a short period of time).
To locate this code, please see my article
Enumeration-based Command Line Utility[
^] and download the source code.
How to locate this function? Let's see… In the article, see the section "6. CommandLine Testing", it explains the utility static class
SA.Universal.Utilities.CommandLineSimulationUtility
. Read about it and locate this class in the source code.
Please try it out and tell me if this is what you needed.
—SA