jsp页面显示字符串太长如何截取字符串,后面用省略号?

2024-11-02 19:33:39
推荐回答(1个)
回答1:

String name = request.getParamert("name");
if(name.length > 10){
name = name.subString(0,10)+"......";
}