I have a set of strings. I want to select all strings that contains another string. But I want to have as the first items, the items that start with the search, and then, alphabetically the other items. But the following code doesn't work:
items = items
.Where(a => a.Contains(contained))
.OrderBy(a => a)
;
var startsWith = items.Where(a => a.StartsWith(contained));
items = startsWith.Union(items.Except(startsWith));
What I have to do?