DanBlog

Il blog di Daniele Armanasco
posts - 48, comments - 73, trackbacks - 10

[C#] Operator ??

The ?? operator returns the left-hand operand if it is not null, or else it returns the right operand.

int y = x ?? -1;

oppure

if ((reader.GetAttribute("showheader") ?? String.Empty).ToUpper() == "TRUE")

Print | posted on giovedì 9 agosto 2007 18:35 | Filed Under [ Scoperte di un principiante ]

Comments have been closed on this topic.

Powered by:
Powered By Subtext Powered By ASP.NET