minus method

  1. @useResult
KtList<T> minus(
  1. KtIterable<T> elements
)

Returns a list containing all elements of the original collection except the elements contained in the given elements collection.

Implementation

@useResult
KtList<T> minus(KtIterable<T> elements) {
  if (this is KtCollection && (this as KtCollection).isEmpty()) {
    return toList();
  }
  return filterNot((it) => KtIterableExtensions(elements).contains(it));
}