日期:2014-05-17 浏览次数:20587 次
List<string> list = new List<string>() {
"1.2.1,1.2.3,1.2.4",
"2.2.1,1.2.3,1.2.4",
"1.2.1,3.2.3,1.2.4,4.3.2,4.5.6,6.7.8,4.6.6,7.8.9,9.6.7",
};
list = list.Select(a => {
string temp = string.Join(",",a.Split(',').OrderBy(b=>b));
temp = Regex.Replace(temp, @"(?<=\G([^,]+?,){2}[^,]+),", "<br/>");
return temp;
}).ToList();