The algorithm is not that simple. I happened to have the solution with full source code, only the delimiter is blank space. I've done this to created a facility to test command line with parameters containing blank spaces guarded with quotation mark. I wanted to do testing not using actual command line. You only need to replace blank space character with comma.
Let me show how to locate it. Go to may article:
Enumeration-based Command Line Utility[
^], locate the section "6. CommandLine Testing" — it explains the class
CommandLineSimulationUtility
. Download the source code and locate this class in a test/demo application.
Enjoy.
—SA