Returns a Boolean value indicating whether the initial elements of the sequence are the same as the elements in another sequence.
- iOS 7.0+
- macOS 10.9+
- tvOS 9.0+
- watchOS 2.0+
- Xcode 8.3+
A sequence to compare to this sequence.
true if the initial elements of the sequence are the same as the elements of
possible has no elements, the return value is
This example tests whether one countable range begins with the elements of another countable range.
Passing a sequence with no elements or an empty collection as
possible always results in
Complexity: O(m), where m is the lesser of the length of the sequence and the length of