标签:
/// <summary> /// 字符串按指定分隔符分隔 /// </summary> /// <param name="str">字符串</param> /// <param name="separator">分隔符</param> /// <returns></returns> public List<string> ConvertToStringList(string str, string separator) { if (string.IsNullOrWhiteSpace(str)) return new List<string>(); var list = str.Split(new[] { separator }, StringSplitOptions.RemoveEmptyEntries); return list.Select(a => a.Trim()).Distinct().ToList(); }
标签:
原文地址:http://www.cnblogs.com/xiaoxiaoyu0707/p/5799721.html