There are multiple ways to prepend an element to the start of a List. The most common method is using cons ::.
xxxxxxxxxx
val fruitList = "orange"::"banana"::"apple"::"grape"::Nil
val fruitList2 = fruitList :+ "peach"
val fruitList3 = "watermelon"::fruitList2
// Driver Code
fruitList3.foreach(println)
Prepending an element to the start of a Vector can be done using the +: method.
xxxxxxxxxx
val patternVector = Vector("a~a", "b~b", "c~c")
val patternVector2 = patternVector :+ "d~d"
val patternVector3 = "1~1" +: patternVector2
// Driver Code
patternVector3.foreach(println)