+7  A: 

String.Empty because it is a static variable, rather than "" which has to create a new string, and null means that you must then set the string equal to a new instance of a string.

(thanks for the correction)

MasterMax1313
Technically, String.Empty is not a constant. It's a static readonly field. If it was a constant, there would be no difference between "" and string.Empty.
Mehrdad Afshari
String.Empty is not a constant, it's a field. Its backing value is a constant, but you have some limitations by String.Empty not being a constant. For example, you can't use it as a value in a case clause of a switch statement.
Michael Meadows
Note that "" *might* create an extra string *once*. It's not like it's going to create a new string every time you go round the code.
Jon Skeet
+3  A: 

It is considered better practise to use string.Empty, however they are effectively equal. They are not the same as null, however.

Ed Woodcock
+6  A: 

Yes. And String.Empty, but please don't worry about it.

Matthew Flaschen
Yeah my thinking is if you're that concerned about memory you shouldn't be using .Net :P
Spencer Ruport
+16  A: 
public sealed class String {
    //...
    public static readonly String Empty = "";
    //...
}

Use null when you want to represent that there is no value;

Use String.Empty when you want to represent that there is a value, but the value is a blank string.

Justice
Fairly importantly, it's also readonly :)
Jon Skeet
I'd say that for lack of a String.Unknown, null can also be used to represent an unknown value (as well as no value).
Michael Meadows
@Jon Skeet good catch!
Justice
Whether `null` means `does not exist` or `exists but is unknown` depends on the way you use it in your program, and the developer should either make the code clear or document it. But there should certainly and absolutely not be a `String.Unknown` because that does not belong in class `String`.
Justice
A: 

FROM http://msdn.microsoft.com/en-us/library/system.string.empty.aspx

The value of this field is the zero-length string, "".

In application code, this field is most commonly used in assignments to initialize a string variable to an empty string. To test whether the value of a string is String..::.Empty, use the IsNullOrEmpty method.

John Nolan
A: 

They are equal . But String.Empty is constant .

"" - is way of creating String .

joe
String.Empty isn't a constant in the C# terminology at least. It's a public static readonly field.
Jon Skeet
Actually, "" is a literal constant, while String.Empty is not constant at all, so you have it reversed.
Michael Meadows
+2  A: 

Use whichever you find most readable.

I challenge anyone to find a realistic application where there's a significant performance difference... it just won't happen. However, different people find different approaches more readable.

Personally, I'm a "" person. I find it less cluttered, and I've never encountered a problem where I actually used " " (or something similar) accidentally. (That's one of the objections frequently raised.)

If you prefer string.Empty, I'm certainly not going to claim you're "wrong". I would suggest, however, that if you're working on a team you discuss it to find out what most people think is more readable, and stick to that. Consistency is generally a good thing.

EDIT: Just to allay some fears which might be induced by the claim that "" will create a new string... it may create a new string once (possibly per AppDomain, possibly per process; I'm not sure and it really doesn't matter). It won't create a new string every time you use it. For example, consider this code:

public void Foo()
{
    string x = "";
    for (int i=0; i < 10000000; i++)
    {
        string y = "";
        // Do something here
    }
    string z = "";
}

You are guaranteed that x, y and z will refer to the same string. At most, invoking Foo will mean a single empty string is created, and only the first time you call it, and only if you haven't used an empty string literal anywhere else in the program yet. The code above is not going to create 10 million new strings.

Jon Skeet
"it may create a new string once" - why would it do that? I'd have thought the empty string literal "" would already be in the intern pool as it has been referenced by the String.Empty property.
Joe
@Joe: I suspect in *some* cases it wouldn't be, but they'd be complicated cases involving things like CompilerRelaxations.NoStringInterning. I strongly suspect it wouldn't usually create *any* strings, but "at most one" is good enough in terms of performance and less likely to be wrong in weird corner cases :)
Jon Skeet
A: 

The answer you are looking for is here.

http://stackoverflow.com/questions/151472/what-is-the-difference-between-string-empty-and/151481#151481

use String.Empty

David Basarab
A: 

null and empty are not equal..