Link to home
Start Free TrialLog in
Avatar of shprakash
shprakash

asked on

Can anyone can rearrange this code in vb.net 2.0

Function gStripNull(ByRef S As String) As Object
            Dim p As Short
            
            p = InStr(S, Chr(0))
            
            If p Then
                  gStripNull = Left(S, p - 1)
            Else
                  'UPGRADE_WARNING: Couldn't resolve default property of object gStripNull. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
                  gStripNull = S
            End If
            
    End Function
ASKER CERTIFIED SOLUTION
Avatar of chrissie1
chrissie1
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Even better

Function gStripNull(Byval S As String) As string
            If S.Contains(chr(o)) Then
                  return Left(S, S.indexof(chr(0))
            Else
                  return S
            End If
    End Function