title: Take first three letters in the string
body: <p>I need to retrieve first three letters </p>
  
  <pre><code>val s ="abc"
  val t = s.substring(0,2).equals("ab")
  case class Test(id :String)
  
  if(t){
    Test("found")
   }else{
     None
   }
  </code></pre>
  
  <p>Is there a efficient way to code for the above logic </p>