Empty string: Difference between revisions

(→‎In depth: Added note about VB runtime in .NET Core)
Line 2,235:
'#Is operator
' The Is operator tests for reference equality. However, which strings are interned is a CLR implementation
' detail and may be unreliable when comparing non-empty strings. The equivalent in C# would be (object)s == String.Empty.
' Note that there is no such operator as Object.op_Equality(Object, Object): the use of the == operator for
' types of type Object is a C# language feature.
P(s Is "")
 
'#Object.ReferenceEquals(Object, Object)
' The previous line is semantically to the following, though it does not. Theinvolve equivalenta inmethod C# wouldcall. be
' (object)s == String.Empty.
' Note that there is no such operator as Object.op_Equality(Object, Object): the use of the == operator for
' types of type Object is a C# language feature.
P(Object.ReferenceEquals(s, ""))
 
Anonymous user