Xperimentality

Building a Better Xperience with .NET

 Monday, November 21, 2005
I just ran across something I guess I have just been missing in playing with the 2.0 framework: The coalescing operator! I love this. Not sure how I have been missing this one. I am a big fan of using something like:

Textbox.Text = (str == null) ? "N/A" : str;

as opposed to using a conditional block. But I just found that I can use:

Textbox.Text = str ?? "N/A";

It is the simple things that make me the happiest! Well, on to finding more things that I have not discovered yet...
Who Am I - Todd Miranda
Me
MVP Visual Developer - ASP/ASP.NET
Search
Links
On this page....
Calendar
<November 2005>
SunMonTueWedThuFriSat
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910
Archives
Aggregate Me!
RSS 2.0 | Atom 1.0 | CDF
Categories
Blogroll
Contact me
Send mail to the author(s) E-mail
Administration