Hi I'm trying to compare char's of one string to other chars on other string but i can't get any good result, what I want to do is something like this
"apem" compare on any order in "sample"
I have a dictionary and i want to return all text wich contains what I'm comparing in a list
foreach (var s in squery ?? new List<DictDatabase>())
{
if (s != null)
{
if (!string.IsNullOrEmpty(s.components))
{
if (s.components.All(j => j.Equals(compare.ToCharArray())))
{
DictList.Add(s);
}
else if(s.components.Contains(compare))
{
DictList.Add(s);
}
}
}
}
the "else if(s.components.Contains" just return a list with the first char what I'm writing, if I enter another char it doesn't return nothing
the "if(s.components.All" statement doesn't anything