There is a string
string str = "0,5(1);1(1);0(2)"; I need to get the numbers that are перед скобками and drive them into the array. I do it like this:
string str = "0,5(1);1(1);0(2)"; Regex rgx = new Regex(@"(\(\d\))"); var result = rgx.Replace(str, "").Split(';'); //"0,5(1);1(1);0(2)"->"0,5;1;0"->{"0,5","1","0"} 1. If there is a more optimal way, please show, since at least 30 000 such lines will have to be processed at a time.
2. Now it is necessary to do the opposite - get the numbers в скобках in the array. How to implement it?