Blame view

MyStringUtils.java 555 Bytes
涂亚平 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
package com.subsidy.util;

import java.util.List;

public class MyStringUtils {


    /**
     *  把集合改成字符串  去掉逗号
     */
    public static String changeListToString(List<String> list) {

        StringBuffer buffer = new StringBuffer();
        if (list.size() > 0) {
            int i= 0 ;
            for (String s : list) {
                buffer.append(s);
                if (i != list.size()-1){
                    buffer.append(",");
                }
            }
        }
        return buffer.toString();
    }





}