title: Splitting the first part of the string using vb.net
body: <p>Below is the perfect working code, when i googled for splitting the first part of the string with a delimiter.</p>
  
  <p>But i have a problem because, this code works only when the target framework is 4
  How can i convert this code, where it will run in target framework 2 </p>
  
  <pre><code>    Public Shared Function FirstFromSplit(ByVal source As String, ByVal delimiter As String) As String
          Dim i = source.IndexOf(delimiter)
  
         Return If(i = -1, source, source.Substring(0, i))
  
      End Function
  </code></pre>