Q:

How can I prepend a string to list of elements in Scala?

I have the following requirement:
val lst = List("a","b","c")
I would like to prepend with the text test to all the elements in the list. The output should be like as below:
testa
testb
testc

A:

val alteredList = lst.map(item => "test" + item)

