a = a.Substring(0, a.Length - 1); //去除最后一位逗号
b = string.Join(",", a.Split(',').Distinct().ToArray());//去字符串去重