A scala implementation of the Java trim method
No good idea about the concern of reversing the list twice. But you may


Let you inner function return a List instead of a string thus having less conversions from list to string and string to list.
Change your match to the following pattern (not tested):

case " " :: tail =&gt; removePreString(tail)
case _ =&gt; _



I just realize you could also use on a list def dropWhile(p: (A) ⇒ Boolean): List[A] which drops longest prefix of elements that satisfy a predicate. You could then chain dropWhile not a space | reverse | dropwhile not a space | reverse...