Untitled
By: a guest | Feb 9th, 2010 | Syntax:
C# | Size: 0.36 KB | Hits: 24 | Expires: Never
List
<string> firstColl
= new List
<string> { "batrado",
"test",
"proba" };
List
<string> secondColl
= new List
<string> { @"\\comp53\batrado",
@"\\comp53\pesho" };
string result = firstColl.FirstOrDefault(s => secondColl.Any(s1 => s1.Contains(s)));
if (result != null) {
// result contains first item found in first collection
} else {
// No matches found
}