title: Cast Any of String to Int
body: <p>I have a variable of type <code>Any</code> with runtime type of <code>String</code> which I want to cast to <code>Int</code>:</p>
  
  <pre><code>val a: Any = "123"
  </code></pre>
  
  <p>If I try to cast in to Int, I'll get an exception <code>java.lang.ClassCastException</code>:</p>
  
  <pre><code>val b = a.asInstanceOf[Int]
  </code></pre>
  
  <p>How do I do that then?</p>