title: SearchString search operation with forename and surname
body: <p>Hi I have one search box that takes searchstring and search it in the database. The input are like &quot;utsav pal&quot;, &quot;utsav p&quot;, &quot;pal&quot; for the account Name Utsav Pal. But I want to use only the initials like &quot;uts pa&quot;. Can any one suggest me what can I do ?</p>
  <p>Here is the logic I have used</p>
  <pre><code>if(!String.IsNullOrEmpty(vm.SearchString)){
   accounts = accounts.where( a =&gt; 
         ((a.Forname != null) &amp;&amp; (a.Forename +&quot;  &quot;+ a.Surname).IndexOf(vm.SearchString, StringComparison.CurrentCultureIgnoreCase) &gt;= 0 ) ||
        ((a.AccountCode != null) &amp;&amp; a.AccountCode.IndexOf(vm.SearchString, StringComparison.CurrentCultureIgnoreCase) &gt;= 0 )
  </code></pre>