Hello, please help me this problem. I want to split "-action=1" to "action" and "1".
string pattern = @"^-(\S+)=(\S+)$";
Regex regex = new Regex(pattern);
string myText = "-action=1";
string[] result = regex.Split(myText);
I don't know why result have length=4.
result[0] = ""
result[1] = "action"
result[2] = "1"
result[3] = ""
Please help me.
P/S: I am using .NET 2.0.
Thanks.
Hello, I tested with string: @"-destination=C:\Program Files\Release" but it have inaccurate result, I don't understand why result's length = 1. I think because it has a white space in string.
I want to split it to "destination" & "C:\Program Files\Release"
More info: This is my requirement: -string1=string2 -> split it to: string1 & string2. In string1 & string2 don't contain characters: '-', '=', but they can contain white space.
Please help me. Thanks.