Question : scala dropwhile syntax
Answered by : clumsy-cod-4f5sweysrwa5
// Creating a list
val m1 = List(3, 6, 5, 4, 2)
// Applying dropWhile method
val res = m1.dropWhile(x=>{x % 3 == 0})
// alternative m1 dropWhile(x=>{x % 3 == 0})
Source : https://www.geeksforgeeks.org/scala-list-dropwhile-method-with-example/ | Last Update : Wed, 07 Sep 22