Java tutorial
//package com.java2s; import java.util.*; public class Main { public final static <K, V> String keyJoin(Map<K, V> map, String separator) { StringBuilder sb = new StringBuilder(); for (Map.Entry<K, V> entry : map.entrySet()) { sb.append(String.valueOf(entry.getKey())).append(separator); } return sb.toString().substring(0, sb.toString().length() - separator.length()); } }