Skip to content

Instantly share code, notes, and snippets.

@pinzolo
Created May 10, 2012 03:04
Show Gist options
  • Save pinzolo/2650763 to your computer and use it in GitHub Desktop.
Save pinzolo/2650763 to your computer and use it in GitHub Desktop.
文字列拡張
using System;
namespace MktSys.Lib.Extensions
{
/// <summary>
/// String クラス拡張メソッド定義クラス
/// </summary>
public static class StringExtension
{
/// <summary>
/// 文字列が空(null含む)かどうかを判別するメソッドを追加する。
/// </summary>
/// <param name="text">文字列</param>
/// <returns>文字列が null か空文字の場合 true を、それ以外の場合 false</returns>
public static bool IsEmpty(this String text)
{
if (text == null)
{
return true;
}
return text.Length == 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment