Converting empty strings to Null

Is there a pre-existing function in VB.NET that converts an empty string to Null, or do you have to write it for yourself.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

An empty string is not the same as a null (in practically any language).  Tell us what you're trying to do (perhaps there is a better way to accomplish the goal).
this is a small function in vb just convert it to

function getnull(str as string) as string
   if str="" then
   end if
end function

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mayank SAssociate Director - Product EngineeringCommented:
Converting that to VB.NET, you can use: Return vbnull and Return str instead of getnull = vbnull and getnull = str.

The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Public Function ConvertStr(ByVal str As String) As String
        If IsNothing(str) Then
            ConvertStr = str
        ElseIf str.Length = 0 Then
            ConvertStr = Nothing
            ConvertStr = str
        End If
    End Function
Mayank SAssociate Director - Product EngineeringCommented:
Accept bhagyesht's comment as answer.
Thanks mayankeagle      

Bhagyesh Trivedi
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.