Is there a way to find the index from list of partial prefixes with Linq, something like:
List<string> PartialValues = getContentsOfPartialList();
string wholeValue = "-moz-linear-gradient(top, #1e5799 0%, #7db9e8 100%)";
int indexOfPartial = PartialValues
.IndexOf(partialPrefix=>wholeValue.StartsWith(partialPrefix));
Unfortunately, IndexOf()
doesn't accept lambda expression. Is there a similar Linq method for this?