My Software : Comments and observations related to the usage and installation of softwares on my systems.
Updated: 2007-02-01; 08:49:34.

 

Subscribe to "My Software" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


Categories: (Check them too. My content isn't all on the main page)

Knowledge Management
Technology
My Hardware
My Software
En français!
Top 20 topics!


Currently reading:

The Second World War, Volume 1: The Gathering Storm by Winston S. Churchill

Beginning Linux Programming (Programmer to Programmer) by Richard Stones and Neil Matthew



www.blogwise.com

Male/31-35. Lives in Canada/Ontario/Ottawa/Manor Park, speaks French and English. Spends 80% of daytime online. Uses a Faster (1M+) connection. And likes Cooking/Reading.
This is my blogchalk:
Canada, Ontario, Ottawa, manor Park, French, English, Male, 31-35, Cooking, Reading.


The Political Compass: Economic Left/Right: -3.50
Authoritarian/ Libertarian:
-2.26


Technorati Profile
Popdex Citations



 
 

10 avril 2003

NullOrEmptyString.

Tired of doing this: "if(s == null || s == String.Empty)"...

public class NullOrEmptyString
{
 public static NullOrEmptyString Value = new NullOrEmptyString();

public static bool operator==(NullOrEmptyString s1, string s2)

{

return ((object)s1) == null || s1.Equals(s2);

}

public static bool operator!=(NullOrEmptyString s1, string s2)

{

return !(((object)s1) == null || s1.Equals(s2));

}

public override int GetHashCode()

{

return String.Empty.GetHashCode();

}

public override bool Equals(object o)

{

return((o is string) && (o == null || (((string)o) == string.Empty)));

}

public static implicit operator string(NullOrEmptyString s)

{

return s.ToString();

}

public override string ToString()

{

return String.Empty;

}

}

[.NET Weblogs]
Neat trick

2:37:17 PM    comment []  - See Also:  .NET 

© Copyright 2007 Charles Nadeau.



Click here to visit the Radio UserLand website.
 



-->
April 2003
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
Mar   May


Google
Search the whole web!
Search Charles radio!


www.flickr.com


Top 5 artists I listen to the most often during the last week:


I subscribe to:

Here's how this works.


Weather in Ottawa:
The WeatherPixie
Weather in Fukuoka:
The WeatherPixie