<s:property value="#mhistr.fcontent"/>struts截断字符串,只要19字符串
<s:if test="#mhistr.fcontent.length()>18">
<s:property value="#mhistr.fcontent.substring(0,18)"/>…
</s:if>
<s:else>
<s:property value="#mhistr.fcontent"/>
</s:else>
str=str.substring(int beginIndex);截取掉str从首字母起长度为beginIndex的字符串,将剩余字符串赋值给str;
str=str.substring(int beginIndex,int endIndex);截取str中从beginIndex开始至endIndex结束时的字符串,并将其赋值给str;
indexOf 方法
返回 String 对象内第一次出现子字符串的字符位置。