Android examples for java.util:Iterable
join Iterable with delimiter
//package com.book2s; import java.util.Iterator; public class Main { public static String join(Iterable<?> pairs, String delimiter) { StringBuilder ret = new StringBuilder(); Iterator<?> it = pairs.iterator(); while (it.hasNext()) { ret.append(it.next());/* ww w . ja v a 2 s .c om*/ if (it.hasNext()) { ret.append(delimiter); } } return ret.toString(); } }