博 之 文

以 拼 搏 设 计 梦 想 , 以 恒 心 编 程 明 天
  首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年1月16日

摘要: *参数说明: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 阅读(405) 评论(0) 推荐(0) 编辑