title: Possible ways to check if a value exists in a sequence scala
body: <pre><code>case class dummy(val prop:Seq[Test])
  case class Test(val s :String)
  case class Result(val s :String)
  
  def myFunc:Result = {
    val s = "11,22,33"
    val t = Test(s)
    val list = dummy(Seq(t))
    val code = Option("25")
    val result = code.exists(p =&gt; {
      list.prop.exists(d =&gt; d.s.split(",").contains(p))
    })
  
    if (result) {
      Result("found")
    } else {
      Result("Not Found")
    }
  }
  </code></pre>
  
  <p>I am calling function <code>myFunc</code>, but instead of evaluating a boolean using if/else construct.</p>
  
  <p>Any possible ways to avoid using If else construct </p>