方法如下:
//在制定位置截取字符并加入自定义符号。默认加入....
public string GetRightSpot(string strContent,int Spot,string strSign)
{
string strContentSub="";
if(strContent.Length>Spot) {strContentSub=strContent.SubString(0,Spot)}
return strContent+strSign;
}
当为NULL时转成""
public string Str_NullAsStr(object strObj,string RtnStr)
{
if((Convert.IsDBNull(strOjb))||(strObj==null)||(strObj.Equals("")))
{return RtnStr};
else
{return (string)strObj;
}
public string Str_NullAsBlank(object strObj)
{
if((Convert.IsDBNull(strObj))||(strObj==null))
{return "";}
else
{return (string)strObj;}
}