How to convert an Option[String]to List [String]in Scala
<p>How to convert an <code>Option[String]</code> to a <code>List[String]</code>? </p>

<p>My <code>Option[String]</code> looks like this : <code>Some("value1,value2")</code></p>

<p>i tried this but with no success </p>

<pre><code>def convertOptionToList(a: Option[String]): List[String] = {

    return a.map(x =&gt; x.split(",").toList)

  }
</code></pre>

<p>At the end i want something like this : List("val1","val2","val3");</p>