提取文本我有一個IEnumerable<T>
收集與名稱,全名及地址。從IEnumerable <T>
的地址如下:
Street1=54, Street2=redfer street, Pin=324234
Street1=54, Street2=fdgdgdfg street, Pin=45654
Street1=55, Street2=tryry street, Pin=65464
我想遍歷這個集合並打印那些名字,FullNames其Street1 = 54
我如何能做到這一點的LINQ?
好,我是能夠做到這一點,以提取地址Street1現在
coll.Address.Split(",".ToCharArray())[0]returns me Street1=54 .
我怎麼添加這個病情及打印只有那些名字,全名,其Street1 = 54
好吧我今後會更新我的問題 – Viks 2009-02-11 15:55:43
我可以這樣做嗎? var result = collection.Where(x => x.Address.Contains(「Street1 =」+ street1))。OrderByDescending(x => x.Name.Length); – Viks 2009-02-11 16:11:06