码迷,mamicode.com
首页 > 其他好文 > 详细

工具类方法

时间:2017-03-06 14:20:13      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:list   append   str   pre   style   string   方法   join   工具   

/*
     * 数组转string,加分隔符
     */
    public static String listJoinToString(String split,Object[] strAry){
        StringBuffer sb=new StringBuffer();
        for(int i=0;i<strAry.length;i++){
            if(i==(strAry.length-1)){
                sb.append(strAry[i]);
            }else{
                sb.append(strAry[i]).append(split);
            }
        }
        return new String(sb);
    }

 

工具类方法

标签:list   append   str   pre   style   string   方法   join   工具   

原文地址:http://www.cnblogs.com/xiaoliu66007/p/6509111.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!