dropWhileLast

The dropLastWhile function accepts a lambda expression. This function keeps ignoring the elements from the end of the list until the condition is satisfied:

newList = numbers.dropLastWhile { it > 5 }
println("Drop from end : while element is greater than 5")
println(newList)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.123.34