A
Abhi
In the following hypothetical example I want to build a generic list
of unique string items.
How should I implement the pred function so that it returns true/false
if target string exists in the generic list...is not clear to me. Any
suggestions?
System.Collections.Generic.List<string> list = new
System.Collections.Generic.List<string>();
foreach(string s in myAnotherArray)
{
System.Predicate<string> p = new System.Predicate<string> (pred);
if(!list.Exists(p))
{
list.Add(s);
}
}
protected bool pred(string target)
{
//TODO: How to find out target string exists in the generic
list????
}
of unique string items.
How should I implement the pred function so that it returns true/false
if target string exists in the generic list...is not clear to me. Any
suggestions?
System.Collections.Generic.List<string> list = new
System.Collections.Generic.List<string>();
foreach(string s in myAnotherArray)
{
System.Predicate<string> p = new System.Predicate<string> (pred);
if(!list.Exists(p))
{
list.Add(s);
}
}
protected bool pred(string target)
{
//TODO: How to find out target string exists in the generic
list????
}