Skip to content

Instantly share code, notes, and snippets.

@kijanawoodard
Created December 8, 2012 01:12
Show Gist options
  • Select an option

  • Save kijanawoodard/4238005 to your computer and use it in GitHub Desktop.

Select an option

Save kijanawoodard/4238005 to your computer and use it in GitHub Desktop.
using System;
namespace FizzBuzz
{
public class ExtensionsDemo
{
public static void TestString()
{
var s = "hello";
var ok = s.HasValue();
s = null;
ok = s.HasValue();
}
}
public static class StringExtensionMethods
{
public static bool HasValue(this string value)
{
return !string.IsNullOrWhiteSpace(value);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment