方法一:
str_leader = string.Join(",", str_leader.Split(',').Distinct().ToArray()); //需要.NET 3.5框架支持
方法二:正则
using System.Text.RegularExpressions; //为使用正则表达式类
str_leader = Regex.Replace(str_leader + ",", @"(?:([^,]+,))(?=.?\1)", "");
方法一:
str_leader = string.Join(",", str_leader.Split(',').Distinct().ToArray()); //需要.NET 3.5框架支持
方法二:正则
using System.Text.RegularExpressions; //为使用正则表达式类
str_leader = Regex.Replace(str_leader + ",", @"(?:([^,]+,))(?=.?\1)", "");