Iyi de Apache Commons bunu bizim icin zaten en guzelinden yapiyor ki
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
public class Gunaydin {
public static void main(String[] args) {
List<String> list = new ArrayList<String>();
list.add("ahmet");
list.add("mehmet");
list.add("mustafa");
List<String> list2 = null;
// Join all Strings in the Array into a Single String, separated by $#$
System.out.println(StringUtils.join(list, "$#$"));
}
}
Outputs:
ahmet$#$mehmet$#$mustafa
Just for clean codings..
No comments:
Post a Comment