title: Scala check if string contains no special chars
body: <p>I have written the following code to check whether a string contains special chars or not. The code looks too complicated to me but I have no idea how to make it simpler. Any Ideas?</p>
  
  <pre><code>def containsNoSpecialChars(string: String): Boolean = {
    val pattern = "^[a-zA-Z0-9]*$".r
    return pattern.findAllIn(string).mkString.length == string.length
  }                                                 //&gt; containsNoSpecialChars: (string: String)Boolean
  
  containsNoSpecialChars("bl!a ")                   //&gt; res0: Boolean = false
  containsNoSpecialChars("bla9")                    //&gt; res1: Boolean = true
  </code></pre>