Mega Code Archive

 
Categories / Java Book / 005 Collection
 

0334 Get the index of sub list

static int indexOfSubList(List<?> source, List<?> target) Returns the starting position of the first occurrence of the specified target list within the specified source list, or -1 if there is no such occurrence. static int lastIndexOfSubList(List<?> source, List<?> target) Returns the starting position of the last occurrence of the specified target list within the specified source list, or -1 if there is no such occurrence.