1 string str = "1,\r\n2,\r\n3,\r\n"; 2 string.Join(",", str.Split(new string[] { ",", "\n", "\r\n" }, StringSplitOptions.RemoveEmptyEntries).Select(s => s)); //结果 : 1,2,3