縮減字符串
使用StringUtils.abbreviate()方法。只要傳給它待縮減的字符串和最大允許縮減長度即可。
StringUtils.abbreviate()方法也能夠在字符串內的某個偏移量處開始縮減。形式如下
StringUtils.abbreviate(message,offset,width),其中message為待縮減的字符串,
offset為偏移量,width為要允許縮減的長度。
posted on 2007-09-17 22:37
Ke 閱讀(1380)
評論(1) 編輯 收藏 所屬分類:
jakarta commons cookbook