首页 > 其他 > 详细

遍历List内容截取字符串

时间:2018-11-02 12:22:40      阅读:178      评论:0      收藏:0      [点我收藏+]
 1 /**
 2      * 限定指数长度为两位
 3      * @return
 4      */
 5     public List<BJtzsZoneComeAndCross> subStringJtzsIndex(List<BJtzsZoneComeAndCross> list){
 6         //list不为空
 7         String index = "";
 8         String Jtzs = "";
 9         if(list != null && list.size() != 0){
10             for (int i = 0; i<list.size();i++){
11                 index = list.get(i).getJtzs();
12                 if (index.length() > 4){
13                     Jtzs = index.substring(0,4);
14                 }
15                 list.get(i).setJtzs(Jtzs);
16             }
17         }
18         return list;
19     }

 

遍历List内容截取字符串

原文:https://www.cnblogs.com/assistants/p/9895555.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!