日期:2014-05-17 浏览次数:20412 次
string str = ".00(2),7.00(1),8.00(4),";
str = Regex.Replace(str, @"(\d*?\.\d+)\((\d+)\)(?=[,,]
------解决方案--------------------
$)", delegate(Match m)
{
string source = "";
int n = Convert.ToInt32(m.Groups[2].Value);
for (int i = 0; i < n; i++)
source += m.Groups[1].Value + (i < n - 1 ? "," : "");
return source;
});