dropRightWhile(predicate: (Element) -> Bool) -> [Element]

Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate returns false.

Parameters

  • predicate: The function invoked per iteration.

Returns

Returns the new sliced array.

[1,2,3,4,5].dropRightWhile{ $0 > 3 }
// -> [1,2,3]