I have a list as follows:
val internalIdList: List[Int] = List()
internalIdList = List(11, 12, 13, 14, 15)
From this list would remove the third element in order to obtain:
internalIdList = List(11, 12, 14, 15)
I can not use a ListBuffer
, are obliged to maintain the existing structure.
How can I do?
Thanks to all
If you insist on using the oldschool method, use collect:
However, I still prefer the method in my other answer.