公司业务需求,想了好久才想出这么个办法,本人菜鸟,留作以后回顾!
Java判断包含某个字符contains方法
jsp页面判断包含某字符的
详细的操作方法或具体步骤
1、这是把数据库里面的数据导出到excel中显示
2、代码如下
if (null !=ar.getCbXz()){
String Str=null;
String Str1=null;
String Str2=null;
String Str3=null;
if(ar.getCbXz().contains("1")){
Str1="交强险";
}else{
Str1="";
}
if(ar.getCbXz().contains("2")){
Str2="车损险";
}else{
Str2="";
}
if(ar.getCbXz().contains("3")){
Str3="三责";
}else{
Str3="";
}
Str=Str1+Str2+Str3;
sheet.addCell(new Label(10, i + 2, Str,contentStyle));// 承保险种
}else{
sheet.addCell(new Label(10, i + 2,"",contentStyle));
}

3、这是jsp页面中的显示
4、代码如下

- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
