public static String cutEucStr(String _str,int len) {
String retStr = "";
try{
if (_str !=null && !"".equals(_str))
{
_str = _str.trim();
if (_str.length()>len)
{
String temp = _str.substring(0,len);
int blank_index = temp.lastIndexOf(" ");
if (blank_index > 0)
{
retStr = _str.substring(0,blank_index)+"...";
}else
{
retStr = temp+"...";
}
}else
{
retStr = _str;
}
}
}catch(Exception ex)
{
retStr = "";
}
return retStr;
}
posted on 2008-12-15 17:12
长春语林科技 阅读(278)
评论(0) 编辑 收藏 所属分类:
util