StringUtil.java
资源名称:shihua.rar [点击查看]
上传用户:zghglow
上传日期:2022-08-09
资源大小:27227k
文件大小:1k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
JavaScript
- package com.chinacannel.common;
- public class StringUtil {
- public static String getSummaryStr(String str, int length) {
- String sTitle = str; ;
- if (str.length() > length) {
- try {
- sTitle = str.substring(0, length - 2) + "...";
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- return sTitle;
- }
- public static String getSummaryStr(String str) {
- return getSummaryStr(str, 16);
- }
- }