0

Possible Duplicate:
What is the difference between String.Empty and “”

Which one is better?

name = System.String.Empty; 

OR

name = "";
0

3 Answers 3

0

I do it because FxCop complains if I don't. More readable?, hardly.

Sign up to request clarification or add additional context in comments.

Comments

0

I use "" as it's considerably easier on the eye than String.Empty. It hasn't caused me any problems as of yet, and I've been developing in .Net for years.

Comments

-1

Edit: This is only true till .NET 1.1. as per What is the difference between String.Empty and "" (empty string)? not true for later versions.

If you say "" you are creating a new object, where as String.Empty is a read-only field already initialized, it creates no object.

1 Comment

Not true as per answers in duplicate question

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.