String Content=rs.getString(content);//你从数据库中取的内容
int len=Content.length();//计算该字符串长度
int row=(len%30==0?(len/30):(len/30+1));//计算有多少行,这里每行30个字
for(int j=0;j<row;j++){
out.println(((j+1)*30>len)?Content.substring(j*30):Content.substring(j*30,(j+1)*30));
out.println("<br>");
}
我想这样就差不多了,别忘了给我加分了,我可是专门为你的。
int len=Content.length();//计算该字符串长度
int row=(len%30==0?(len/30):(len/30+1));//计算有多少行,这里每行30个字
for(int j=0;j<row;j++){
out.println(((j+1)*30>len)?Content.substring(j*30):Content.substring(j*30,(j+1)*30));
out.println("<br>");
}
我想这样就差不多了,别忘了给我加分了,我可是专门为你的。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货