Java判断包含某个字符contains方法
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)); }

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:61
阅读量:73
阅读量:34
阅读量:83
阅读量:61