1. 程式人生 > >將Collection轉轉換成帶分隔符的字串的幫助類

將Collection轉轉換成帶分隔符的字串的幫助類

import java.util.Collection;
import java.util.Iterator;

public class ConvertUtil {
	public static String convertByMask(Collection collection,String mask){
		String rs="";
		Iterator iterator=collection.iterator();
		while(iterator.hasNext()){
			String sp=(String) iterator.next();
			rs+=sp+mask;
		}
		return rs;
	}
}