Computer Passion

By Anthony J. Fusco

Check for null before calling ToString()

Check for null before calling ToString()

Handy little snippet of code for checking for null before calling ToString(). I found this little bit of code pretty clever and handy. Let us avoid those errors: private static string ToSafeString(object obj) {    return (obj ?? string.Empty).ToString(); } Source Share me… Facebook AccessDeniedAccess DeniedK21C5V02HNNR48RBEsXdYCrZ6vMDKmeu4+7E9AMu7q0E5Vh7HfAS702/jbASF8+bkoDAQQCk6Hzc1WzNzeWhIYmMMYM= AccessDeniedAccess DeniedJRXPF89EFX6YJD4AY8Ufw01gS6KOijpDIyfr4DExHh4KKkluIM/t/egesZkC7WliiRNkfTlDYeJXiYbFJcr8+FHSt5c=Google Twitter Pinterest Email Linkedin

Flexbox Froggy – Learn Flexbox basics quickly and easily.

Flexbox Froggy – Learn Flexbox basics quickly and easily.

I came across the site Flexbox Froggy while speaking with coworkers. Flexbox Froggy is a very helpful site in learning what flexbox is all about. If you have never used Flexbox before I strongly recommend checking it out. If you are curious about flexbox or just getting started with it check it out here: Flexbox Froggy. ARead more about Flexbox Froggy – Learn Flexbox basics quickly and easily.[…]