I am trying to convert my way of getting values from Form
, but stuck some where
val os= for {
m <- request.body.asFormUrlEncoded
v <- m._2
} yield v
os
is scala.collection.immutable.Iterable[String]
and when i print it in console
os map println
console
sedet impntc
sun
job
03AHJ_VutoHGVhGL70
i want to remove the first and last element from it.
Use drop
to remove from the front and dropRight
to remove from the end.
def removeFirstAndLast[A](xs: Iterable[A]) = xs.drop(1).dropRight(1)
Example:
removeFirstAndLast(List("one", "two", "three", "four")) map println
Output:
two
three