bool转成字符串
2014-12-31 14:54:41 访问(1872) 赞(0) 踩(0)
/// <summary>
/// bool转成字符串
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public string StringConvertByBoolean(bool theValue)
{
if (theValue == true)
return "1";
else
return "0";
}
/// <summary>
/// bool?转成字符串
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
public string StringConvertByBooleanNull(bool? theValue)
{
if (theValue == null)
return "";
if (theValue == true)
return "1";
else
return "0";
}
标签:
bool转成字符串 


上一条:
下一条:
相关评论
发表评论