Kri*_*shh 3 c# regex c#-3.0 c#-4.0
我有这个字符串:
string resultString="section[]=100§ion[]=200§ion[]=300§ion[]=400";
Run Code Online (Sandbox Code Playgroud)
我只是想号码存储阵列中的result[]像
result[0]=100
result[1]=200
result[3]=300
result[4]=400
Run Code Online (Sandbox Code Playgroud)
谁能帮我这个.
NameValueCollection values = HttpUtility.ParseQueryString("section[]=100§ion[]=200§ion[]=300§ion[]=400");
string[] result = values["section[]"].Split(',');
// at this stage
// result[0] = "100"
// result[1] = "200"
// result[2] = "300"
// result[3] = "400"
Run Code Online (Sandbox Code Playgroud)