namespace HStation.Service.Assets { /// /// /// public class KeyWordHelper { //分割字符 private const char _split = ','; /// /// 转化为字符串 /// public static string ToString(IEnumerable list) { if (list == null || list.Count() < 1) { return string.Empty; } return string.Join(_split.ToString(), list.Select(x => x.Trim())); } /// /// 转化为列表 /// public static List ToList(string str) { if (string.IsNullOrEmpty(str)) { return new List(); } return str.Split(_split, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToList(); } } }