I can roll a method, pseudo:
bool Compare(IList left, int lIndex, IList right, int rIndex, int num) { for(int i=0;i<num;++i) { if(left[lIndex+i] != right[rIndex+i]) { return false; } } return true; } So given L =[1,2,3,4,5,6,7,8] and R = [5,6,7,8,9] : Compare(L,5,R,1,3) == true
I feel I should be able to do a simple LINQ version but I am not sure how to handle the indexing. Can it be written as a trivial LINQ/lambda... otherwise I'll pull this out as a utility method.
By the way there is a question with a very similar title but it is asking a different thing: https://stackoverflow.com/questions/33812323/compare-two-arrays-using-linq