The Artima Developer Community
Sponsored Link

.NET Buzz Forum
C# COALESCE operator

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Richard Jonas

Posts: 147
Nickname: rjonas
Registered: Nov, 2005

Richard Jonas is a .NET sofware developer living in the UK.
C# COALESCE operator Posted: May 4, 2006 5:16 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Richard Jonas.
Original Post: C# COALESCE operator
Feed Title: Richard Jonas
Feed URL: http://feeds.feedburner.com/blogspot/ouNA
Feed Description: Richard Jonas's blog about .NET, web development and agile methodologies.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Richard Jonas
Latest Posts From Richard Jonas

Advertisement
A useful function in T-SQL is COALESCE, which takes two arguments and returns the first if it is not null and the second if the first is null. I found out today about a feature in C# 2.0 that I had somehow missed which does the same thing (via Avner Kashtan's blog). String a = null; String b = "abc"; String c = a ?? b; returns "abc". These can also be chained, so the first non-null argument

Read: C# COALESCE operator

Topic: [Update] Martin Fowler updates his article on Continuous Integration Previous Topic   Next Topic Topic: [Axinom] AxCMS.net goes XHTML 1.0 strict for CSS Spring Reboot

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use