遍历List内容截取字符串


 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                 }else{
            Jtzs = Index;
           }
15 list.get(i).setJtzs(Jtzs); 16 } 17 } 18 return list; 19 }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM