using System.Collections; using System.Collections.Generic; using System.Linq; namespace iWareCommon.Utils { public class IEnumerableHelper { /// /// 在指定的迭代器中获取特点键的值 /// /// /// /// public static string GetValue(IEnumerable datas, string key) { var str = ""; foreach (var data in datas) { if (data.ToString().StartsWith(key + ": ")) { str = data.ToString().Substring(key.Length + ": ".Length); break; } } return str; } } }