Search code examples
c#stringclassautoboxingtype-equivalence

Equivalence of String and string in C# test


Possible Duplicate:
String vs string in C#

I have a test in C# code I'm reading:

if (variable is string)

I am wondering if this is strictly equivalent to:

if (variable is String)

or if some esoteric behavior of C# autoboxing may cause these tests to behave differently.


Solution

  • They are exactly the same - string is an alias for System.String.