It is easy to split a line of arguments using:
// get arguments for myProg.exe /n /b /c
string.Split(' ');
What about the following list:
// get arguments for myProg.exe /n /b /c:"MyProg 4.0"
Will string split help even in this case?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Reposting my comment as an answer.
Since the command-line arguments come as a string array with argv, there is really no need to do any splitting at all:
If you call the program like:
myProg.exe /n /b /c:"MyProg 4.0", you should see the following:The only time splitting will be needed is when you’re parsing a specific argument.