elementsEqual

inline fun <T> Iterable<T>.elementsEqual(other: Iterable<T>): Boolean(source)

Determines whether two iterables contain equal elements in the same order. More specifically, this method returns true if this and other contain the same number of elements and every element of other is equal to the corresponding element of other.

See also


inline fun <T> Iterator<T>.elementsEqual(other: Iterator<T>): Boolean(source)

Determines whether two iterators contain equal elements in the same order. More specifically, this method returns true if this and other contain the same number of elements and every element of this is equal to the corresponding element of other.

Note that this will modify the supplied iterators, since they will have been advanced some number of elements forward.

See also