Java判断包含某个字符contains方法

 时间:2026-02-14 21:12:45

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));

}

Java判断包含某个字符contains方法

2、这是jsp页面中的显示

4、代码如下

<td align="center" nowrap="nowrap">

  <c:if test="${fn:contains(item.cbXz,1) }">交强险</c:if> 

  <c:if test="${fn:contains(item.cbXz,3) }">三责</c:if> 

  <c:if test="${fn:contains(item.cbXz,2) }">车损险</c:if> 

  </td>

Java判断包含某个字符contains方法

  • TortoiseSVN客户端如何进行中文配置?
  • 各种netstat命令的用法
  • 局域网中如何设置代理地址实现上网
  • oracle 11g 登陆方式
  • python如何查看系统默认的关键词
  • 热门搜索
    内存卡写保护怎么去掉 福特福克斯怎么样 怎么看股票 宫外孕是怎么回事 origin怎么设置中文 家风家训怎么写 北京师范大学珠海分校怎么样 怎么会爱上你 圣安地列斯怎么下载 建筑占地面积怎么算