Question: [I am trying to convert my way of getting values from `Form`, but stuck some where](https://stackoverflow.com/questions/24204907/how-to-get-from-optionmapstring-seqstring-contains-key-or-not/24205706#24205706)

```
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.

Answer: 
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

```
Another way is to use `slice`.

```
val os: Iterable[String] = Iterable("a","b","c","d")
val result = os.slice(1, os.size - 1) // Iterable("b","c")

```