scala add to list
def::[B >: A](elem: B): List[B]
Adds an element at the beginning of this list.
elem is the element to prepend.
returns a list which contains x as first element
and which continues with this list.
Example:
1 :: List(2, 3) = List(2, 3).::(1) = List(1, 2, 3)
Are there any code examples left?
New code examples in category Scala
-
Scala 2022-02-22 13:40:10 scala length of string
-
Scala 2022-02-15 01:00:25 scala get file from url as string
-
Scala 2022-01-31 13:41:22 comments in scala
-
Scala 2022-01-30 20:36:46 scala set contains all
-
Scala 2022-01-30 17:46:32 scala get the first element of a seq
-
Scala 2021-11-22 08:48:22 scala predicate
-
Scala 2021-11-19 20:09:21 scalar matrix
-
Scala 2021-11-16 07:19:22 scala read input
-
Scala 2021-11-15 06:42:25 scala jrtpath
-
Scala 2021-11-10 10:13:04 scala iterator foreach