Anonymous user
Empty string: Difference between revisions
m
→Visual Basic .NET#In depth: Edited some more
m (→Visual Basic .NET#In depth: Clarified) |
m (→Visual Basic .NET#In depth: Edited some more) |
||
Line 2,276:
'#Object.Equals(Object, Object)
' First checks for reference equality and whether one or both of the arguments
' instance Equals method of the left parameter.
P(Object.Equals(s, ""))
Line 2,291:
'#String.Length
' Check the Length property. The ?. (null-
' call above can also be done this way.
' A method call must be added because the equality operator propagates Nothing/null (that is, the result of the
Line 2,302:
'#String.Length
' A more traditional version of the null-
' Both the null-
' for empty strings, using the length is faster than using an equality comparison.
P(s IsNot Nothing AndAlso s.Length = 0)
|