摘要:
*参数说明:oldStr为原字符串,maxLength为截取长度,endWith为在末尾加入的字符*/public static string StringTruncat(string oldStr, int maxLength, string endWith){if (string.IsNullOrEmpty(oldStr))//原字符串为空时仅返回endWith{return oldStr + endWith;}if (maxLength<1)//指定长度必须大于0{throw new Exception("返回的字符串长度必须大于0");}if (oldStr. 阅读全文
posted @ 2012-01-16 17:18 IsNull_Soft 阅读(406) 评论(0) 推荐(0) 编辑