日期:2014-05-17 浏览次数:20434 次
void Main() { string s="indicator[0].radicetion[0].kodsad"; int[] replace={1,3}; int i=0; s=Regex.Replace(s,@"(?<=\[)\d+(?=\])",m=>replace[i++].ToString()); Console.WriteLine(s); //indicator[1].radicetion[3].kodsad }