Below is the perfect working code, when i googled for splitting the first part of the string with a delimiter.
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
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
As far as know both string-methods exists in 2.0, so I guess it’s the return-statement that gives troubles.
Try re-writing it in the old style.