Does this do what you want ?
public static int? Match(int start_index, string searchTerm)
{
var wanted = _properties
.Select((prop,i) => new { Index = i, Item = prop(_itemType) })
.Skip(start_index)
.FirstOrDefault(value => value.Item != null && value.Item.ToLower().Contains(searchTerm.ToLower()));
return wanted==null ? null : (int?)wanted.Index;
}
- Use select with the second index parameter and store it in an anonymous type.
- Then skip past the number specified in 'start_index'.
- Then search the remainder and if one is found, return the original index.