I want to split a string into parts, to retrieve arguments.
I already made that function:
static private string getparam(string input, int index)
{
string[] arrparams = input.Split(' ');
if (arrparams.Length <= index) return "";
return arrparams[index];
}
But when i pass an argument like:
upload C:\Visual Studio
it will see "C:\Visual" as the first argument and "Studio" as the second and split em.
Now i thought about making something like an exception in the Split-Function: When the argument is given between quotes, it should ignore the spaces in it.
Then, when i pass the arg like this: upload "C:\Visual Studio", the first argument should be C:\Visual Studio
So how could i implement this?
Thank you.