difference between "" and String.Empty

R

Rohn Farrington

Hi All,

Was just courious is there any performance/managebility issue while using ""
or String.Empty.

for example

Dim str As String = String.Empty '// first
Dim str As String = "" '// second
i.e. which one will run faster?

Thanks in advance
F
 
J

John Saunders

Rohn Farrington said:
Hi All,

Was just courious is there any performance/managebility issue while using
"" or String.Empty.

for example

Dim str As String = String.Empty '// first
Dim str As String = "" '// second

Dim str As String ' Will run even faster!

You don't need to initialize every variable when it is declared (and you
don't need to declare all of your variables at the beginning of your
methods). Just make sure each is initialized before use.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top