startsWith

fun <T> List<T>.startsWith(prefix: List<T>): Boolean

Returns true if this list begins with the elements of prefix in order.

An empty prefix always matches. Runs in O(prefix.size).