Collections.LastIndexOfSubList Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.
[Android.Runtime.Register("lastIndexOfSubList", "(Ljava/util/List;Ljava/util/List;)I", "")]
public static int LastIndexOfSubList (System.Collections.Generic.IList<object> source, System.Collections.Generic.IList<object> target);
[<Android.Runtime.Register("lastIndexOfSubList", "(Ljava/util/List;Ljava/util/List;)I", "")>]
static member LastIndexOfSubList : System.Collections.Generic.IList<obj> * System.Collections.Generic.IList<obj> -> int
Parameters
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.
- Attributes
Remarks
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. More formally, returns the highest index i
such that source.subList(i, i+target.size()).equals(target)
, or -1 if there is no such index. (Returns -1 if target.size() > source.size()
)
This implementation uses the "brute force" technique of iterating over the source list, looking for a match with the target at each location in turn.
Added in 1.4.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.